Quellcode durchsuchen

docs: record the CASE-label rung (ladder 14195)

CALC-COMPILE.md: the rung table gains v-TP3-CALC-CASELIST (8a265e7,
ERR 102 14195), the session state says nineteen rungs, the baseline is
the run just made (75/75 compile, 64/64 executed under both oracles,
non-vacuity 95/95), and the next-session plan marks item 11 done and
item 4 - variable array subscripts - as the next rung.

SUMMARY.md: the intro now stops at ERR 102 14195 and lists case labels
and ranges among the landed features.
Eric Streit vor 1 Tag
Ursprung
Commit
5d19ee5717
2 geänderte Dateien mit 31 neuen und 24 gelöschten Zeilen
  1. 26 20
      CALC-COMPILE.md
  2. 5 4
      SUMMARY.md

+ 26 - 20
CALC-COMPILE.md

@@ -97,7 +97,7 @@ Current rung (measured today, normalised position):
 
 | position | blocker |
 |---|---|
-| **13052** | `'G', 'I', 'O', 'Q':' in `IBMCh` — a comma-separated CASE label list (`ERR 1`) |
+| **14195** | `XPos[Count]` in `DisplayP` — a variable array subscript (`ERR 102`) |
 
 Rungs behind it (now passed):
 
@@ -116,12 +116,13 @@ Rungs behind it (now passed):
 | 12083 | `NormVideo`/`LowVideo`/`Delay` | attribute byte + busy loop; and the repeat-body parser bug fixed |
 | 12672 | `KeyPressed` | `INT 21h AH=0B`, in Exec86 and bootcom too |
 | 12901 | `var` parameters | by reference + DupTest shadowing (`t73_varparam`) |
+| 13052 | comma-separated CASE labels | plus real CASE ranges (`t74_caselist`) |
 
 Rungs ahead:
 
 | position | blocker |
 |---|---|
-| 13052 | comma-separated CASE labels; then the rest of `CALC.INC` |
+| 14195 | variable array subscripts (scaled addressing); then the rest of `CALC.INC` |
 
 Corrections the measurements force, worth stating plainly because the stage list
 below was written before them:
@@ -395,12 +396,13 @@ ladder order (each stage removes the blocker the previous one exposed).
 
 ### Session state — where to resume
 
-Last touched 2026-10-21. **Eighteen rungs are landed across three sessions**
+Last touched 2026-10-21. **Nineteen rungs are landed across three sessions**
 (Stages 1-4, sets, enums, record types, array declarations, element/field
 access, file types, the calling convention and string value parameters,
-`Length`, the CRT identifiers, `Kbd`, `KeyPressed`, and `var` parameters).
-The ladder row has moved from the first typed constant at 7791 to **13052,
-inside `CALC.INC`'s `IBMCh` — its comma-separated CASE labels**.
+`Length`, the CRT identifiers, `Kbd`, `KeyPressed`, `var` parameters, and the
+CASE labels).  The ladder row has moved from the first typed constant at 7791
+to **14195, inside `CALC.INC`'s `DisplayP` — `XPos[Count]`, a variable array
+subscript**.
 
 The rung commits and their tags, in order (each is one rung with its own
 fixture, red proof, and — where the harness allows — execution under qemu and
@@ -425,10 +427,11 @@ Exec86):
 | `4c165e1` | `v-TP3-CALC-KBD` | `ERR 102 12083` (`NormVideo`) |
 | `89c6ca6` | `v-TP3-CALC-CRT2` | `ERR 41 12672` (`KeyPressed`) |
 | `033eb8e` | `v-TP3-CALC-KEYPRESSED` | `ERR 41 12901` (`IBMCh`'s `var` parameter) |
-| `5eb82c4` | `v-TP3-CALC-VARPARAM` | **`ERR 1 13052`** (comma-separated CASE labels) |
+| `5eb82c4` | `v-TP3-CALC-VARPARAM` | `ERR 1 13052` (comma-separated CASE labels) |
+| `8a265e7` | `v-TP3-CALC-CASELIST` | **`ERR 102 14195`** (variable array subscript) |
 
-- **Code HEAD** `5eb82c4` (`v-TP3-CALC-VARPARAM`); this commit only updates
-  this document.  Nothing pushed; `origin/master` is behind by eleven code
+- **Code HEAD** `8a265e7` (`v-TP3-CALC-CASELIST`); this commit only updates
+  this document.  Nothing pushed; `origin/master` is behind by twelve code
   commits.  Two non-ladder commits in the same period are the terminal-config
   work (`v-TP3-TERMCFG`) and the editor key map (`v-TP3-EDITORKEYS`); they do
   not move the ladder and are documented in `TERMINAL.md`.
@@ -530,10 +533,10 @@ Exec86):
   byte-for-byte the same for INTEGER locals, so the compile matrix would have
   been green and only `t40_readln` (and later CALC) would have noticed.
 - **Verified baseline, run on the code HEAD above:** `./tests/run_all.sh` →
-  **OVERALL: ALL PASS**, compile matrix **74/74**, CALC ladder **1/1** at
-  `ERR 1 13052`, terminal config **4/4**, 64 `.COM` linked and **63 executed
+  **OVERALL: ALL PASS**, compile matrix **75/75**, CALC ladder **1/1** at
+  `ERR 102 14195`, terminal config **4/4**, 64 `.COM` linked and **64 executed
   under both qemu and Exec86** (`t64_arrays` is compile-only: its image is past
-  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **94 ok, 0 failed**.
+  the 8 KB boot-sector read).  `tests/nonvacuity.sh`: **95 ok, 0 failed**.
 - **`tests/nonvacuity.sh`:** re-run after this commit's cases (the set
   membership bit among them); see the commit message for the count. It is not in
   the default `run_all.sh` and must be run **manually** after touching any check.
@@ -569,7 +572,8 @@ Exec86):
 
 ### Next session — the concrete plan
 
-The ladder is at `ERR 1 13052`, **`IBMCh`'s comma-separated CASE labels**.  Everything
+The ladder is at `ERR 102 14195`, **`XPos[Count]`, a variable array
+subscript**.  Everything
 below is ordered by what the ladder will hit next, not by the original stage
 numbers (the measurements have reordered them repeatedly).  Each item is the
 same shape as the rungs already landed: one focused change, one fixture that is
@@ -594,9 +598,12 @@ commit.
    `IoResult`; `read`/`write` with a leading file argument).  Runtime entries
    doing `INT 21h` open/create/read/write/close, text-mode newline and `^Z`.
    The file *types* and variables are already in place (`FileVarSize`).
-4. **Variable-index subscripts** (`Sheet[FX,FY]`, `XPOS[Ch]`, `b[i]`) and
-   **`with`** — scaled run-time addressing; the second dimension strides by the
-   first range's count.  Constant indices and `.field` are already done.
+4. **Variable array subscripts — THE NEXT RUNG (14195).**  `XPos[Count]`,
+   `Sheet[FX,FY]`, `b[i]`: a constant index folds into `boff`, but a run-time
+   index needs the element size applied (`base + (i - lo) * elemsize`) before
+   the element's address is formed.  String subscripts already do the
+   one-byte case (v-TP3-STRIDX-VAR); arrays need the scale and the row stride
+   for the second dimension.  `with` follows on the same addressing work.
 5. **Pointers and the heap** (`^T`, `New`, `Dispose`, `Buffer^[i]`), 4-byte
    (offset then segment); the heap must hold `Pages` (16,281 bytes).
 6. **`var` parameters by reference — DONE** (`v-TP3-CALC-VARPARAM`).  The slot
@@ -615,10 +622,9 @@ commit.
 10. **Recursion, `forward`, nesting** — `Fact` (direct self-recursion) and
     `Expression`/`Factor` (mutual via `forward`, the definition repeating only
     the name).
-11. **The `case` labels — THE NEXT RUNG (13052).**  `case Ch of 'H': ...
-    'G', 'I', 'O', 'Q': ... end`: the parser reads one label and then demands
-    `':'`, so a comma-separated list is `ENoSemi`.  Char labels themselves
-    (`^E`, `#27`) already parse; the list is what `IBMCh` uses.
+11. **The `case` labels — DONE** (`v-TP3-CALC-CASELIST`): comma-separated
+    lists, and ranges now really test `lo <= AX <= hi` (they used to require
+    `AX = lo = hi`, so `1..5` matched nothing).  `t74_caselist` pins both.
 
 Then the two that are *outside* the ladder and gate the goal as stated:
 

+ 5 - 4
SUMMARY.md

@@ -2037,15 +2037,16 @@ census of what `CALC.PAS` actually needs and the reference measurements from
 the original `TURBO.COM`. Two tracks run in parallel: the ladder (front-end,
 verifiable on small fixtures) and the layout (§3, the only thing that stops
 the compiler *emitting* a 16,560-byte program). The ratchet and front-end
-features through **`var` parameters** are landed: the ladder
+features through **comma-separated CASE labels** are landed: the ladder
 (`tests/calc_ladder.sh` + `tests/fixtures/calc_ladder.tsv`, run by `run_all.sh`;
-CALC.PAS now stops at `ERR 1` at pos 13052, `IBMCh`'s comma-separated case labels), the `{$I}` include,
+CALC.PAS now stops at `ERR 102` at pos 14195, `XPos[Count]` in `DisplayP`), the `{$I}` include,
 `^X`/`#nn`, scalar typed constants, sets, enums, records (CellRec = 80),
 subranges, arrays, element/field access, file types, string value parameters,
 `Length`, the CRT identifiers (`ClrScr`/`GotoXY`/`ClrEol`/`LowVideo`/
 `NormVideo`/`Delay`), `Kbd`, `KeyPressed` (`INT 21h AH=0B`), `var` parameters
-(by reference; `t73_varparam`), and `INT 10h`+`C6` in Exec86 (fixtures through
-`t73_varparam`). The next rung is comma-separated CASE labels; then the remaining string
+(by reference; `t73_varparam`), comma-separated CASE labels and real CASE
+ranges (`t74_caselist`), and `INT 10h`+`C6` in Exec86 (fixtures through
+`t74_caselist`). The next rung is variable array subscripts; then the remaining string
 builtins, file operations, variable-index subscripts + `with`, pointers, `var`
 params, reals, recursion, and the layout change. Items 1-4 below are
 independent of both.