Document optional line numbers

Chapter 2 gets the rule and the refusal, chapter 4 gets the payoff for
LABEL, chapter 9 says DSAVE writes the numbers it handed out and to
RENUMBER first if you want gaps, chapter 10 shows a host loading numberless
source, chapter 13 gets the QuickBASIC-shaped divergence, and chapter 14's
source[] passage gets its second half.

Chapter 14 said "two prescans" and listed two; there were three before this
and there are four now, so it lists all four and says which of them reports
against the right line.

TODO.md section 6 records four things found on the way and deliberately not
fixed: set_label() filing into the active scope rather than the root, three
prescans reporting the wrong line number, duplicate written line numbers
still replacing silently, and renumber.c's file-scope scratch arrays.

examples/embed.c runs the same program twice, numbered and not, so the
example compiles the feature rather than describing it. Its header pointed
at ./build/examples/embed, which is not where the binary lands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-01 16:43:14 -04:00
parent 6273be580a
commit 28ea99a638
8 changed files with 240 additions and 5 deletions

View File

@@ -20,6 +20,12 @@ OK
`VERIFY`. A program is saved as plain text with its line numbers, so you can edit it in
anything.
**`DSAVE` always writes line numbers, including ones you did not.** A program loaded
from a file that had none is given them
([Chapter 2](02-getting-started.md#a-program-in-a-file-does-not-need-them)), and those
are what gets written back. They come out one apart, so there is no room to insert
between them: `RENUMBER` before `DSAVE` if you want the gaps.
`VERIFY` compares what is in memory against the file and prints `OK`, or reports how
many lines differ.