From 337c6ada248d6b7db61c43be4e8c50635fe04592 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sat, 24 Jan 2026 15:46:09 +1100 Subject: [PATCH] Actually fix the bug --- src/interpreter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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");