HEAD bb94cad. Tags v3-step8.2, v3-step8.2-summary, v3-step8.3.
Suite 105/105, build warning-free, tree clean, no remote
(git.txt untracked).
Both hand-written compiler modules compile clean under V3:
SymTab (step 8.2) and QbeGen (this step).
docs/summary_step8.2.md):
named-CONST folding, forward type refs in a TYPE block, trailing
; in records, qualified type names (Module.Type), table
capacities (256→4096 types), compact z-filled array data.docs/summary_step8.3.md):
QbeGen.mod: gm2's
FORWARD is unusable (whole-program pass errors
too many errors in pass 3; reproduced minimally) and reorder
cascades. Fix = declare the 10 internal helpers in
QbeGen.def (already the "everything the parser calls" surface).ARRAY OF CHAR:
QbeGen.DeclCharStr + ActParam coercion; cleared the last
85 QbeGen errors.StatSeq = Statement { ";" [ Statement ] }
(Coco/R emits ;;); new test t_emptystat (42).| Source | Under V3 |
|---|---|
SymTab.def/.mod |
clean |
QbeGen.def/.mod |
clean |
M2S.def/.mod (Coco/R scanner) |
30 errors |
M2P.def/.mod (Coco/R parser) |
errors (mostly cascade) |
M2.mod (driver) |
needs stdlib/strings in the session |
GetCH = PROCEDURE (INT32):
CHAR;, procedure variables (CurrentCh: GetCH;), and the
Error: PROCEDURE (...) callback in M2S.def. The main M2S
blocker (invalid Type then cascade). Step-9-sized: function
pointers + indirect calls in QBE.INT32 alias resolution in M2S.mod var/param types seen as
"not a type name" — recheck once procedure types parse.FileIO open-file cap MaxFiles = BitSetSize (16)
blocks compiling all ~16 modules in one session (Too many
files). Raise it, or use the self-hosted FileIO.Then: cross-stage FileIO selection and bootstrap/fixpoint.sh
(Stage1 gm2 → Stage2 V3 → Stage3 V3, byte-identical .ssa).
cd /home/eric/Projets/Projets-Modula2/MyWork/m2compiler-V3/compiler
./build.sh && ./run_tests.sh # expect 105/105, no gm2 warnings
# SymTab/QbeGen gap check (needs a stub program, /tmp/gap.mod):
printf 'MODULE Gap;\nIMPORT SymTab;\nVAR ExitCode : INTEGER;\nBEGIN ExitCode := 0 END Gap.\n' > /tmp/gap.mod
./M2 ../stdlib/storage.def ../stdlib/storage.mod \
../runtime/syslib/SysShim.def ../runtime/syslib/SysShim.mod \
../runtime/syslib/FileIO.def ../runtime/syslib/FileIO.mod \
src/SymTab.def src/SymTab.mod src/QbeGen.def src/QbeGen.mod \
/tmp/gap.mod
# M2S (keep the session small — host FileIO caps at 16 open files):
./M2 ../stdlib/storage.def ../stdlib/storage.mod \
../runtime/syslib/SysShim.def ../runtime/syslib/SysShim.mod \
../runtime/syslib/FileIO.def ../runtime/syslib/FileIO.mod \
src/M2S.def src/M2S.mod /tmp/gap.mod