Implemented groupings

This commit is contained in:
2022-08-07 15:04:19 +01:00
parent d7fda480fd
commit 9a415738d9
9 changed files with 124 additions and 21 deletions

View File

@@ -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");