File tree 1 file changed +7
-3
lines changed
snap-core/src/test/java/org/snapscript/core/stack
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public Result compile(Scope scope) throws Exception {
32
32
Result result = statement .compile (scope );
33
33
34
34
if (result .isDeclare ()){
35
- depth .getAndIncrement ();
35
+ depth .getAndIncrement (); // this is probably not too useful
36
36
}
37
37
}
38
38
} finally {
@@ -44,7 +44,9 @@ public Result compile(Scope scope) throws Exception {
44
44
public Result execute (Scope2 scope ) throws Exception {
45
45
Result last = ResultType .getNormal ();
46
46
State2 state2 = scope .getStack ();
47
- State2 next = state2 .create (); // allow the stack to grow in a compound statement!!
47
+ //int size = state2.size(); // how many will be allocated
48
+
49
+
48
50
49
51
if (!compile .get ()) {
50
52
throw new InternalStateException ("Statement was not compiled" );
@@ -59,7 +61,9 @@ public Result execute(Scope2 scope) throws Exception {
59
61
last = result ;
60
62
}
61
63
}finally {
62
- next .clear ();
64
+ //state2.reset(size); // we cannot create a new stack frame, we just remove variables created
65
+ // // this is because a compound scope has access to all variables in
66
+ // // in the stack...
63
67
}
64
68
return last ;
65
69
}
You can’t perform that action at this time.
0 commit comments