Three of the four prescans report against the wrong line #10

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

Source: TODO.md §6 item 27 (at 9151438)

akbasic_runtime_set_mode()'s handler builds its BASIC error line from environment->lineno,
which after a load is wherever the loader stopped -- usually the last line of the program.

The label, DATA and TYPE scans therefore print ? 47 : for a fault on line 3, and work around
it by putting Line %d: in the message text (src/structtype.c:342), so the message names the
number twice and the prefix is wrong.

akbasic_runtime_check_targets() does not have the problem because it points
environment->lineno at the line it is walking. That is the fix, and it belongs in the wrapper
rather than in four places:
give each prescan a way to say which line it failed on, or have each
set the cursor as the target check does.

Cosmetic, but it is the first number a person reads when a program will not start.

Files: src/runtime.c (akbasic_runtime_set_mode), src/structtype.c:342


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

**Source:** TODO.md §6 item 27 (at 9151438) `akbasic_runtime_set_mode()`'s handler builds its BASIC error line from `environment->lineno`, which after a load is wherever the loader stopped -- **usually the last line of the program.** The label, `DATA` and `TYPE` scans therefore print `? 47 :` for a fault on line 3, and work around it by putting `Line %d:` in the message text (`src/structtype.c:342`), **so the message names the number twice and the prefix is wrong.** `akbasic_runtime_check_targets()` does not have the problem because it points `environment->lineno` at the line it is walking. **That is the fix, and it belongs in the wrapper rather than in four places:** give each prescan a way to say which line it failed on, or have each set the cursor as the target check does. Cosmetic, **but it is the first number a person reads when a program will not start.** **Files:** `src/runtime.c` (`akbasic_runtime_set_mode`), `src/structtype.c:342` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.1.x milestone 2026-08-02 19:04:16 -04:00
tachikoma added the defectblast-radius:mediumstatus::grooming labels 2026-08-02 19:04:16 -04:00
Sign in to join this conversation.