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:
2024-12-30 16:56:57 +11:00
parent b84a70cc34
commit 23eb3e45df
4 changed files with 182 additions and 29 deletions

View File

@@ -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