calc_ladder.tsv 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # The CALC ladder — the ratchet for the work in CALC-COMPILE.md.
  2. #
  3. # One row per program, in the same shape run_compile_tests.sh asserts against
  4. # tests/fixtures/expected.tsv:
  5. #
  6. # <program> OK <code> <data>
  7. # <program> ERR <tp3-error-no> <normalised-pos>
  8. #
  9. # tests/calc_ladder.sh stages a COPY of the named program — and of the
  10. # companions that must sit beside it — into tmp/calc_ladder/ and runs the
  11. # freshly built compiler on it. A copy, not the Resources file itself: the
  12. # include (Stage 2 of CALC-COMPILE.md) resolves relative to the including file,
  13. # so CALC.INC has to be beside CALC.PAS in the staged tree.
  14. #
  15. # The rung may only move FORWARD. Each stage that removes a blocker replaces
  16. # the row in the SAME commit as the fix and says why in the message. Never
  17. # edit a row to make a failing suite pass; that is the one thing this file
  18. # exists to prevent.
  19. #
  20. # pos is NOT a file offset. TextBuf.LoadFile collapses CRLF and a lone LF to a
  21. # single CR, so pos indexes the NORMALISED buffer: CALC.PAS is 11,241 bytes on
  22. # disk and 11,059 normalised, so the reported 7791 is file byte 7901. Every
  23. # position written here is a normalised one. Once {$I CALC.INC} lands the
  24. # buffer is CALC.PAS with the directive replaced by CALC.INC, so all downstream
  25. # positions shift — which is exactly why this must be a measured number, not a
  26. # remembered one.
  27. #
  28. # Current rung (2026-10-23): `Copy(Formula,...)' inside Factor's real Val.
  29. # UpCase, run-time set membership, string fields through DI, the original memory
  30. # layout, untyped-file declarations, file control-block operations, VAR string
  31. # parameters, Chr, typed-file block I/O, text-file output, Str,
  32. # pointers/New/dereference, text Eof/Readln, Str(integer), Val(integer), VAR/
  33. # value REAL and REAL function results, REAL literals/comparisons/arithmetic,
  34. # self-recursion, enum-indexed arrays, string-array typed constants and local
  35. # REAL variables moved the ladder 15911 -> 18267 -> 19847 -> 20912 -> 22253 ->
  36. # 22280 -> 22706 -> 22859 -> 23700 -> 25674 -> 26066 -> 26924 -> 27648 ->
  37. # 28074 -> 31758 -> 32096 -> 32284 -> 32482 -> 32564 -> 33374 -> 33537 ->
  38. # 33778 -> 35135. The next blocker is the Copy string builtin (TP3 error 41).
  39. CALC.PAS ERR 41 44567