Skip to content

Commit 43b3539

Browse files
committed
Add additional notes
1 parent 0ffa4c6 commit 43b3539

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

snap-core/src/test/java/org/snapscript/core/stack/CompoundStatement2.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Result compile(Scope scope) throws Exception {
3232
Result result = statement.compile(scope);
3333

3434
if(result.isDeclare()){
35-
depth.getAndIncrement();
35+
depth.getAndIncrement(); // this is probably not too useful
3636
}
3737
}
3838
} finally {
@@ -44,7 +44,9 @@ public Result compile(Scope scope) throws Exception {
4444
public Result execute(Scope2 scope) throws Exception {
4545
Result last = ResultType.getNormal();
4646
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+
4850

4951
if(!compile.get()) {
5052
throw new InternalStateException("Statement was not compiled");
@@ -59,7 +61,9 @@ public Result execute(Scope2 scope) throws Exception {
5961
last = result;
6062
}
6163
}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...
6367
}
6468
return last;
6569
}

0 commit comments

Comments
 (0)