mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Keywords 'break' & 'continue' tested
There were a couple bugs - I'm glad I'm so thorough with these tests. See #152
This commit is contained in:
@@ -508,7 +508,7 @@ static unsigned int writeInstructionWhileThen(Toy_Routine** rt, Toy_AstWhileThen
|
||||
|
||||
unsigned int diff = depth - (*rt)->currentScopeDepth;
|
||||
|
||||
OVERWRITE_INT(rt, code, addr, addr - (CURRENT_ADDRESS(rt, code) + 8)); //tell continue to return to the start AFTER reading the instruction
|
||||
OVERWRITE_INT(rt, code, addr, CURRENT_ADDRESS(rt, code) - (addr + 8)); //tell continue to return to the start AFTER reading the instruction
|
||||
OVERWRITE_INT(rt, code, addr, diff);
|
||||
|
||||
//tick down
|
||||
|
||||
@@ -581,6 +581,7 @@ static void processEscape(Toy_VM* vm) {
|
||||
|
||||
while (diff > 0 && vm->scope != NULL) {
|
||||
vm->scope = Toy_popScope(vm->scope);
|
||||
diff--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user