added compound statements

This commit is contained in:
cozis
2021-11-01 03:20:07 +00:00
parent e67231f321
commit 97c3c15ea0
8 changed files with 138 additions and 4 deletions
+11
View File
@@ -342,6 +342,8 @@ static _Bool step(Runtime *runtime, Error *error)
case OPCODE_MUL:
case OPCODE_DIV:
{
assert(opc == 0);
Object *rop = Stack_Top(runtime->stack, 0);
Object *lop = Stack_Top(runtime->stack, -1);
@@ -363,6 +365,15 @@ static _Bool step(Runtime *runtime, Error *error)
break;
}
case OPCODE_POP:
{
assert(opc == 1);
if(!Runtime_Pop(runtime, error, ops[0].as_int))
return 0;
return 1;
}
case OPCODE_PUSHINT:
{
assert(opc == 1);