mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Implemented groupings
This commit is contained in:
@@ -199,7 +199,7 @@ static bool execArithmetic(Interpreter* interpreter, Opcode opcode) {
|
||||
|
||||
//catch bad modulo
|
||||
if (opcode == OP_MODULO) {
|
||||
printf("Bad arithmetic argument (modulo on floats not allowed)");
|
||||
printf("Bad arithmetic argument (modulo on floats not allowed)\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ static bool execArithmetic(Interpreter* interpreter, Opcode opcode) {
|
||||
}
|
||||
|
||||
//wrong types
|
||||
printf("Bad arithmetic argument");
|
||||
printf("Bad arithmetic argument\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -269,6 +269,13 @@ static void execInterpreter(Interpreter* interpreter) {
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_GROUPING_BEGIN:
|
||||
execInterpreter(interpreter);
|
||||
break;
|
||||
|
||||
case OP_GROUPING_END:
|
||||
return;
|
||||
|
||||
default:
|
||||
printf("Unknown opcode found %d, terminating\n", opcode);
|
||||
printLiteralArray(&interpreter->stack, "\n");
|
||||
|
||||
Reference in New Issue
Block a user