mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
cleaning up tests
This commit is contained in:
@@ -306,7 +306,7 @@ static Opcode writeCompilerWithJumps(Compiler* compiler, Node* node, void* break
|
||||
//pass to the child nodes, then embed the binary command (math, etc.)
|
||||
Opcode override = writeCompilerWithJumps(compiler, node->binary.left, breakAddressesPtr, continueAddressesPtr, jumpOffsets);
|
||||
|
||||
//special case for when indexing
|
||||
//special case for when indexing and assigning
|
||||
if (override != OP_EOF && node->binary.opcode >= OP_VAR_ASSIGN && node->binary.opcode <= OP_VAR_MODULO_ASSIGN) {
|
||||
writeCompilerWithJumps(compiler, node->binary.right, breakAddressesPtr, continueAddressesPtr, jumpOffsets);
|
||||
compiler->bytecode[compiler->count++] = (unsigned char)override + 2; //1 byte WARNING: enum arithmetic
|
||||
@@ -314,6 +314,11 @@ static Opcode writeCompilerWithJumps(Compiler* compiler, Node* node, void* break
|
||||
return OP_EOF;
|
||||
}
|
||||
|
||||
//compensate for... yikes
|
||||
if (override != OP_EOF) {
|
||||
compiler->bytecode[compiler->count++] = (unsigned char)override; //1 byte
|
||||
}
|
||||
|
||||
//return from the index-binary
|
||||
Opcode ret = writeCompilerWithJumps(compiler, node->binary.right, breakAddressesPtr, continueAddressesPtr, jumpOffsets);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user