Skip to content

Commit

Permalink
Add additional notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ngallagher committed Dec 13, 2016
1 parent 0ffa4c6 commit 43b3539
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Result compile(Scope scope) throws Exception {
Result result = statement.compile(scope);

if(result.isDeclare()){
depth.getAndIncrement();
depth.getAndIncrement(); // this is probably not too useful
}
}
} finally {
Expand All @@ -44,7 +44,9 @@ public Result compile(Scope scope) throws Exception {
public Result execute(Scope2 scope) throws Exception {
Result last = ResultType.getNormal();
State2 state2 = scope.getStack();
State2 next = state2.create(); // allow the stack to grow in a compound statement!!
//int size = state2.size(); // how many will be allocated



if(!compile.get()) {
throw new InternalStateException("Statement was not compiled");
Expand All @@ -59,7 +61,9 @@ public Result execute(Scope2 scope) throws Exception {
last = result;
}
}finally {
next.clear();
//state2.reset(size); // we cannot create a new stack frame, we just remove variables created
// // this is because a compound scope has access to all variables in
// // in the stack...
}
return last;
}
Expand Down

0 comments on commit 43b3539

Please sign in to comment.