Block skipping works by source line, so a whole FOR/NEXT on one line never loops #6

Open
opened 2026-08-02 19:04:13 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md §4 and §8 (at 9151438)

FOR I# = 1 TO 3 : PRINT I# : NEXT I# does not loop.

The block structure is the reference's waitingForCommand model, which skips forward by source
line
to the verb it is waiting for, so a NEXT on the same line as its FOR is never
reached. That is inherited structure rather than a slip, and it did not matter until a line
could hold more than one statement
-- which it now can.

DO/LOOP/WHILE/UNTIL are exactly the verbs people write on one line, so this is structural
work that comes before anything else in that area rather than a defect to schedule around.

Fixing it means restructuring control flow to work on statements rather than lines, which is a
deliberate piece of work and wants its own commit.

Files: src/runtime.c (the waitingForCommand skip), src/parser_commands.c


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md §4 and §8 (at 9151438) `FOR I# = 1 TO 3 : PRINT I# : NEXT I#` does not loop. The block structure is the reference's `waitingForCommand` model, which **skips forward by source *line*** to the verb it is waiting for, so a `NEXT` on the same line as its `FOR` is never reached. That is inherited structure rather than a slip, and **it did not matter until a line could hold more than one statement** -- which it now can. `DO`/`LOOP`/`WHILE`/`UNTIL` are exactly the verbs people write on one line, so this is structural work that comes before anything else in that area rather than a defect to schedule around. **Fixing it means restructuring control flow to work on statements rather than lines**, which is a deliberate piece of work and wants its own commit. **Files:** `src/runtime.c` (the `waitingForCommand` skip), `src/parser_commands.c` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.2.0 milestone 2026-08-02 19:04:13 -04:00
tachikoma added the defectdesign-decisionblast-radius:highstatus::grooming labels 2026-08-02 19:04:13 -04:00
Sign in to join this conversation.