You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Claim (a) has one exception. `g4::parse` accepts a grammar whose action
body the translator cannot render; that failure is at codegen, so the
carve-out named a second exception the parser does not have, and pointed
at a file that documented neither. `README.md` and `AGENTS.md` follow.
The channel remap says what makes it correct rather than what its fallback
branch does: a `channels { }` block is the grammar's own numbering, so
inside its range an id and the name declared at that index are one channel.
`arms_are_one_level` replaces three copies of the same fold.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2Kw2ucQ6fpgwK1KH8CzLC
Copy file name to clipboardExpand all lines: package-gale/AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Files headed `// Do not edit by hand` are generated. To change one, edit its sou
23
23
24
24
## Compatibility principle
25
25
26
-
Gale targets full compatibility with the ANTLR4 `.g4` syntax. The g4 parser must accept any well-formed grammar upstream `antlr4` accepts; a real-world `.g4` that ANTLR4 accepts but Gale rejects is a Gale bug. The exceptions are enumerated under claim (a) in [`antlr4-compatibility.md`](./antlr4-compatibility.md)— today an action body Gale's translator cannot render, and `import Foo = Bar;`.
26
+
Gale targets full compatibility with the ANTLR4 `.g4` syntax. The g4 parser must accept any well-formed grammar upstream `antlr4` accepts; a real-world `.g4` that ANTLR4 accepts but Gale rejects is a Gale bug. The one exception is `import Foo = Bar;`; claim (a) in [`antlr4-compatibility.md`](./antlr4-compatibility.md)carves it out.
27
27
28
28
- Compatibility is a capability contract, not byte-for-byte output. Parse trees, tokens, and semantics must match; incidental rendering differences that carry no structure may diverge (e.g. the `<EOF>` marker in `toStringTree()`).
29
29
- Gale is a superset: it may accept grammars ANTLR4 rejects only when the meaning is uniquely determined by Gale's language model — never an invented behavior. When accepting would require guessing, reject loudly. Examples: `.`/`~X`-led left-recursive suffixes, and a lexer `mode` inside a combined `grammar` (ANTLR4 allows modes only in a `lexer grammar`; a combined grammar already bundles a lexer, so it desugars unambiguously — still rejected in a `parser grammar`).
0 commit comments