diff --git a/src/interpreter.c b/src/interpreter.c index 7565ea0..8330f90 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -443,6 +443,7 @@ GroundStruct parseStruct(GroundProgram* in, GroundScope* scope, size_t errorOffs addInstructionToProgram(&gp, in->instructions[i]); i++; } + i--; GroundFunction* function = parseFunction(&gp, errorOffset); function->startLine = i; @@ -509,6 +510,7 @@ GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope) { addInstructionToProgram(&gp, in->instructions[i]); i++; } + i--; GroundFunction* function = parseFunction(&gp, errorOffset); function->startLine = i; @@ -546,6 +548,7 @@ GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope) { addInstructionToProgram(&gp, in->instructions[i]); i++; } + i--; GroundValue gv = { .type = STRUCTVAL, @@ -571,7 +574,6 @@ GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope) { count--; } } - i--; } if (in->instructions[i].type == STRUCT) { int count = 1; @@ -587,7 +589,6 @@ GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope) { count--; } } - i--; } if (in->instructions[i].type == PAUSE || instructionsToPause == 0) { printf("Paused execution\n");