浏览代码

Coco/R differential results (GM2 vs gm2)

52-case syntax differential of the GNU-grammar GM2 validator against
gm2 -fiso: 21 real files, 22 accepted constructs, 9 broken probes.
Findings: FORWARD headings unparseable (85 diags on M2P.mod, fix
proposed), 6/7 broken files caught at matching positions, END-name
mismatch unchecked, syntax-only misses documented as by design.
Eric Streit 1 周之前
父节点
当前提交
e2387c4a77
共有 1 个文件被更改,包括 25 次插入 和 0 次删除
  1. 25 0
      extensions/modula2-language/COCOR-LSP.md

+ 25 - 0
extensions/modula2-language/COCOR-LSP.md

@@ -58,3 +58,28 @@ The reference grammar lives at `grammars/Modula2.atg` (copy of the
 tested `gm2-gcc-0.2.atg`); parser regression tests live in
 `grammars/tests/` and are checked with
 `<GNU-grammar>/bin/GM2 <test>.mod` (expect `0 errors`).
+
+## Differential results (GM2 vs `gm2 -fiso`)
+
+Measured with `bin/GM2` against gm2 16.0.1: 21 real files
+(m2compiler-V3, m2-sunrise, hello), 22 accepted-construct probes and
+9 broken probes. GM2 is syntax-only by design — it never type-checks,
+so semantic errors (unknown names, type mismatches, bad arities) are
+always missed and do not count below. GM2 exits 0 either way;
+consumers must parse stdout.
+
+- Valid files: 20/21 clean. The one gap is `FORWARD` procedure
+  headings (85 diags on the generated `M2P.mod`): the grammar's
+  `ProcedureDeclaration = ProcedureHeading ";" ( ProcedureBlock Ident )`
+  has no `FORWARD` alternative, while gm2 accepts it. Probable fix:
+  `( "FORWARD" | ProcedureBlock Ident )` (plus regenerating the
+  validator with the Coco/R toolchain).
+- Accepted constructs: 21/22, same `FORWARD` gap. `WITH`, `CASE`/`ELSE`,
+  `REPEAT`, `LOOP`/`EXIT`, nested comments, set constructors, all
+  literal forms, `BY -1` steps and the empty module all parse.
+- Broken files: 6/7 caught with gm2-matching positions (GM2 columns
+  are zero-based, which the server already accounts for — no column
+  adjustment needed). Missed: module `END`-name mismatch (unchecked).
+  Two probes were correctly *not* errors: gm2 itself only warns on a
+  missing `;` before `END` and on an unclosed `(` (separator/recovery
+  leniency), and GM2 agrees with it.