← board

Dynamic-grow the remaining fixed compiler arrays (AST, fixups, labels)

The pattern (proven on IR)

  1. Change array[0..MAX_X-1] of Tarray of T (read/write [i] syntax unchanged, so no access site changes).
  2. Add EnsureXCapacity(need) that doubles from a small base and grows ALL parallel arrays in lockstep; call it at the ONE append chokepoint.
  3. Drop the Error('X overflow').
  4. Gate: self-host byte-identical (dogfoods pxx's own global-dynarray SetLength) + a generated over-cap test.

The remaining caps (each surfaced while testing the IR fix)

Non-goal / caveat

The seq-walk recursion depth (~3500 chained statements SIGSEGVs the compiler in the recursive AST/IR tree walk) is a DIFFERENT problem — a stack-depth limit, not an array cap. Converting arrays won't fix it; that needs an explicit worklist/iterative walk (or a bigger compiler stack). File separately if it bites real code.

Acceptance

Per array converted: self-host byte-identical, a generated over-cap test compiles + matches FPC, make test green. Do them one at a time (AST first — highest value).

SUPERSEDED 2026-07-18

Folded into [[feature-dynamic-compiler-tables]] (the canonical umbrella, which now carries the proven incremental-on-master approach + IR/AST done + the remaining priority list). AST is DONE (d11bf05a); the fixups/labels live under that ticket.