@@ -173,10 +173,7 @@ public boolean getDefinedBoolean() {
173
173
* @return A RuntimeScalar representing the typeglob.
174
174
*/
175
175
public RuntimeScalar scalar () {
176
- RuntimeScalar ret = new RuntimeScalar ();
177
- ret .type = RuntimeScalarType .GLOB ;
178
- ret .value = this ;
179
- return ret ;
176
+ return new RuntimeScalar (this );
180
177
}
181
178
182
179
/**
@@ -321,25 +318,26 @@ public RuntimeGlob undefine() {
321
318
}
322
319
323
320
/**
324
- * Saves the current state of the instance.
325
- *
326
- * <p>This method creates a snapshot of the current value,
327
- * and pushes it onto a static stack for later restoration. After saving, it clears
328
- * the current elements and resets the value.
321
+ * Saves the current state of the typeglob.
329
322
*/
330
323
@ Override
331
324
public void dynamicSaveState () {
332
- throw new PerlCompilerException ("not implemented: local GLOB" );
325
+ GlobalVariable .getGlobalCodeRef (this .globName ).dynamicSaveState ();
326
+ GlobalVariable .getGlobalArray (this .globName ).dynamicSaveState ();
327
+ GlobalVariable .getGlobalHash (this .globName ).dynamicSaveState ();
328
+ GlobalVariable .getGlobalVariable (this .globName ).dynamicSaveState ();
329
+ GlobalVariable .getGlobalIO (this .globName ).dynamicSaveState ();
333
330
}
334
331
335
332
/**
336
- * Restores the most recently saved state of the instance.
337
- *
338
- * <p>This method pops the most recent state from the static stack and restores
339
- * the value. If no state is saved, it does nothing.
333
+ * Restores the most recently saved state of the typeglob.
340
334
*/
341
335
@ Override
342
336
public void dynamicRestoreState () {
343
- throw new PerlCompilerException ("not implemented: local GLOB" );
337
+ GlobalVariable .getGlobalIO (this .globName ).dynamicRestoreState ();
338
+ GlobalVariable .getGlobalVariable (this .globName ).dynamicRestoreState ();
339
+ GlobalVariable .getGlobalHash (this .globName ).dynamicRestoreState ();
340
+ GlobalVariable .getGlobalArray (this .globName ).dynamicRestoreState ();
341
+ GlobalVariable .getGlobalCodeRef (this .globName ).dynamicRestoreState ();
344
342
}
345
343
}
0 commit comments