Implemented scopes

This commit is contained in:
2024-10-27 13:44:09 +11:00
parent d22b18ed17
commit c5206daaea
10 changed files with 90 additions and 9 deletions

View File

@@ -482,6 +482,14 @@ static void process(Toy_VM* vm) {
//temp terminator
return;
case TOY_OPCODE_SCOPE_PUSH:
vm->scope = Toy_pushScope(&vm->scopeBucket, vm->scope);
break;
case TOY_OPCODE_SCOPE_POP:
vm->scope = Toy_popScope(vm->scope);
break;
//various action instructions
case TOY_OPCODE_PRINT:
processPrint(vm);