antlr/antlr4 breaking changes
swift12 curated breaking changes across major versions of antlr/antlr4. Use this as a migration checklist before bumping dependencies.
- 4.5.3 \u2192 4.6breaking
**Error handling** improved in cases related to LL(1) decisions for optional and closure subrules. Matching sets of tokens were also sometimes considered resynchronization (error) tokens. Single token deletions that occurred at the start of expressions were sometimes not included in the parse tree as error nodes.
- 4.5.3 \u2192 4.6breaking
[Add `sync()` calls back in for LL(1) decisions.](https://github.com/antlr/antlr4/issues/1337) (code-gen, error-handling)
- 4.5.3 \u2192 4.6breaking
[Matched tokens being marked as error](https://github.com/antlr/antlr4/issues/1299) (comp:runtime, error-handling, trees-contexts, type:bug)
- 4.5.3 \u2192 4.6breaking
[Single-token deletion error node not in parse tree](https://github.com/antlr/antlr4/issues/1298) (error-handling, trees-contexts, type:bug)
- 4.5.3 \u2192 4.6breaking
The tool itself generates **better error messages**:
- 4.2.2 \u2192 4.3breaking
Within an embedded action or semantic predicate, references to the enclosing rule can no longer be written as `$ruleName`. Instead, use the special symbol `$ctx` to refer to the enclosing rule. Parsers already generated from grammars prior to this change are not affected, but the grammar will need to be updated prior to generating code with ANTLR 4.3. This change was required as part of correcting #571.
- 4.2.2 \u2192 4.3breaking
`IntervalSet.getMinElement` now returns the first element, even if that element is negative. Code which relied on this method to return a non-negative value even if the set contained negative values will need to be updated.
- 4.2.1 \u2192 4.2.2breaking
`LexerATNSimulator.closure`
- 4.2.1 \u2192 4.2.2breaking
`LexerATNSimulator.getEpsilonTarget`
- 4.2.1 \u2192 4.2.2breaking
`ParserATNSimulator.closure`
- 4.2.1 \u2192 4.2.2breaking
`ParserATNSimulator.closureCheckingStopState`
- 4.2.1 \u2192 4.2.2breaking
`ParserATNSimulator.closure_`
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/breaking/swift/antlr/antlr4