summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-03-25 15:40:07 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-03-25 15:40:07 -0400
commit8f86708daa697274a39f8b0af42291a4ed4573eb (patch)
treeb65d71d2cdc88f7825f3e4f129c16a161d498361
parent4c78377a46884d66ba5c2a622382b9a205673e4f (diff)
Don't include next control
-rw-r--r--compiler.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler.c b/compiler.c
index 5291c83..8822359 100644
--- a/compiler.c
+++ b/compiler.c
@@ -5613,7 +5613,8 @@ void p2_compile_control(Scope *s, Function *f, CompData *out, Vector *tokens, si
vect_push_string(&out->text, ": ; Start label\n");
// Main loop statements
- for(; *pos <= end; *pos = tnsl_next_non_nl(tokens, *pos)) {
+ *pos = tnsl_next_non_nl(tokens, *pos - 1);
+ for(; *pos < end; *pos = tnsl_next_non_nl(tokens, *pos)) {
t = vect_get(tokens, *pos);
if (tok_str_eq(t, "/;") || tok_str_eq(t, ";;")) {
size_t b_open = *pos;