mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Increment and decrement operators work
This commit is contained in:
@@ -176,6 +176,18 @@ static bool execPushLiteral(Interpreter* interpreter, bool lng) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool rawLiteral(Interpreter* interpreter) {
|
||||
Literal lit = popLiteralArray(&interpreter->stack);
|
||||
|
||||
if (!parseIdentifierToValue(interpreter, &lit)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pushLiteralArray(&interpreter->stack, lit);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool execNegate(Interpreter* interpreter) {
|
||||
//negate the top literal on the stack (numbers only)
|
||||
Literal lit = popLiteralArray(&interpreter->stack);
|
||||
@@ -657,6 +669,12 @@ static void execInterpreter(Interpreter* interpreter) {
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_LITERAL_RAW:
|
||||
if (!rawLiteral(interpreter)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case OP_NEGATE:
|
||||
if (!execNegate(interpreter)) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user