|
|
@@ -158,3 +158,43 @@ tests and the suite are green; the fixpoint is green (`-lower` is not
|
|
|
used there).
|
|
|
|
|
|
Suite **204/204**; FIXPOINT OK (3,695,508 bytes), session 0 errors.
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+## Progress: more Lower coverage (`132a981`, tag `v3-lower7-gaps`)
|
|
|
+
|
|
|
+First divergence moved to `AST.AddTxt` (line ~6961). Fixes:
|
|
|
+
|
|
|
+- **CASE chunking.** The arm list was capped at `AST.MaxChild` (8):
|
|
|
+ `CaseStat`/`CaseAlt` appended arms with `SetChild(cnode, NChild, arm)`,
|
|
|
+ which silently drops beyond 8. They now build a chunked arm sequence
|
|
|
+ (`AstAppend`, container kind `NkBlock`), and `LowerCase` follows the
|
|
|
+ continuation chunks. This was the big `M2S.Get` gap.
|
|
|
+- **`VAL(T, e)`** in `LowerBuiltinExpr`, same widen/narrow/convert chain
|
|
|
+ as the grammar.
|
|
|
+- **Qualified calls** (`FileIO.ReadBytes`) resolve through Lower's proc
|
|
|
+ tables (SymTab's scopes are closed); `CalleeAlias` returns the base
|
|
|
+ name so the mangled symbol stays `<base>_<uid>`.
|
|
|
+- **VAR actuals.** `LowerExprFull` records value→address with
|
|
|
+ `NoteAddr`, mirroring the grammar's `Design`; `AddrOfVal` could not
|
|
|
+ rely on the grammar's notes because its 256-entry ring wraps during a
|
|
|
+ whole-session emit.
|
|
|
+- **Bare proc values** (`CurrentCh := CharAt`): `Resolve` recognises the
|
|
|
+ proc table and `LowerProcAddr` emits the code address; sibling method
|
|
|
+ names fall through to the THIS-binding path.
|
|
|
+
|
|
|
+## Next blocker: symbol scoping
|
|
|
+`Lower`'s symbol table is a single **flat, latest-wins** table, so
|
|
|
+common names (`s`, `i`, `k`) collide across procedures. E.g. `HIGH(s)`
|
|
|
+in `AST.AddTxt` (an open-array parameter) resolved to a fixed array of
|
|
|
+256 from another procedure. `lower_ok` tests are too small to collide.
|
|
|
+
|
|
|
+Two ways forward:
|
|
|
+1. record a scope id per symbol and resolve within the active procedure
|
|
|
+ chain, or
|
|
|
+2. run `Lower` with `SymTab`'s scope open (the grammar-based call) and
|
|
|
+ resolve locals via `SymTab` first — the earlier attempt only broke
|
|
|
+ `EndModule`'s `ExitCode` lookup, fixable by materialising the program
|
|
|
+ globals in `EndSession`.
|
|
|
+
|
|
|
+Suite **204/204**; FIXPOINT OK (3,711,028 bytes), session 0 errors.
|