|
|
@@ -1,9 +1,19 @@
|
|
|
MODULE local_array_bug;
|
|
|
-(* Repro: a local ARRAY inside a PROCEDURE is miscompiled by V3.
|
|
|
- Expected exit 60; observed 1 (as of v3-ast-slice5, 2026-10-03).
|
|
|
- Found while self-hosting the two-phase statement AST (IfStat used a
|
|
|
- local ARRAY OF AST.Node); moved to module scope to keep the fixpoint
|
|
|
- green. Module-level arrays work; local ones do not. *)
|
|
|
+(* MISDIAGNOSED (2026-10-05). The original report said a local ARRAY
|
|
|
+ inside a PROCEDURE was miscompiled. The actual cause was the module
|
|
|
+ *name*: this grammar's scanner did not accept `_` in identifiers
|
|
|
+ (`ident = letter { letter | digit }`), so `local_array_bug` lexed as
|
|
|
+ `local` + `_array_bug` and the module body was silently dropped
|
|
|
+ (empty `main`).
|
|
|
+
|
|
|
+ FIXED: `M2.atg`'s ident rule now includes "_"
|
|
|
+ (`ident = letter { letter | digit | "_" }`), per ISO Modula-2.
|
|
|
+ Regression: compiler/tests/t_under.mod.
|
|
|
+
|
|
|
+ Local arrays themselves compile correctly; e.g. with a camelCase
|
|
|
+ module name this same program exits 60. See also
|
|
|
+ tests/t_lower5arr.mod for local arrays of records and open-array
|
|
|
+ arguments. *)
|
|
|
|
|
|
VAR ExitCode : INTEGER;
|
|
|
|