m2comp-step1.1)Follow-up to step 1 (m2comp-step1): one grammar fix found while
writing a full-syntax showcase, plus the showcase itself as a
regression test.
Type was missing the bare-subrange alternative [lo .. hi]
(only IndexType had it), so TYPE Sub = [0 .. 9]; failed with
invalid Type. Added the alternative to Type, mirroring
SimpleType in m2c/pimmod2.atg. Still LL(1)-clean, rebuilt
via build.sh (M2compP.mod regenerated).tests/showcase.mod (accepted)Exercises every M2comp.atg production in one program module:
IMPORT forms (FROM In IMPORT x, IMPORT y, z);CONST with decimal, 0FFH hex, reals (3.14, 2.0E+3),
both string quotes, unary-minus expr (-N + 2);Type alternatives: qualified+subrange (INTEGER[1..N]),
bare [0..9], abbreviated 2-D ARRAY, RECORD/empty record,
SET OF, POINTER TO;VAR params, function result, nesting;MODULE with [Priority], FROM..IMPORT,
EXPORT QUALIFIED, own procedure + BEGIN init body;IF/ELSIF/ELSE, WHILE, REPEAT/UNTIL, LOOP/EXIT, FOR/BY,
RETURN with and without expression;= # <> < <= > >= IN), OR/AND/NOT/DIV/MOD,
+x, -Factor (-k + 1), ^ deref, multi-index m[1,2],
dotted Local.q, nested (* *) comments.run_tests.sh)| test | result |
|---|---|
| ok_minimal | accepted |
| ok_proc | accepted |
| showcase | accepted |
| bad_mismatch | rejected (Incorrect source) |
MODULE
declarations need ; not . (END Local;).<> (§2.2)? (*$ *) pragma
section (§2.3/2.4)? Nested-ARRAY OF ARRAY long-form flag
(step-2 semantic check)?SymTab (200/201/202/210-224 checks) + MC64 backend.