tunnelvisionlabs / antlr4

The highly-optimized fork of ANTLR 4 (see README)
Other
73 stars 12 forks source link

Do not explore beyond rule stop states when computing possible next tokens during error recovery #85

Open br0nstein opened 10 months ago

br0nstein commented 10 months ago

Fixes https://github.com/tunnelvisionlabs/antlr4/issues/84

br0nstein commented 10 months ago

Note this aligns with the implementation of https://github.com/antlr/antlr4/blob/v4.11.1/runtime/Java/src/org/antlr/v4/runtime/atn/LL1Analyzer.java#L186

Running performance tests against java.lang classes directory shows no impact to the execution time.

br0nstein commented 10 months ago

@sharwell can you review when you have a chance? If this optimized fork is still maintained. After merging I will port to the Typescript and C# optimized fork targets as well.

KvanTTT commented 10 months ago

If this optimized fork is still maintained.

I'm afraid it's not.

daniellansun commented 9 months ago

@br0nstein LGTM, so I merged your PR into my fork[1] and released 4.13.1.1, which will be used by Apache Groovy[2].

[1] https://github.com/daniellansun/antlr4/commit/0e8c76e336961577ca01a7a6992531fc0a694b69 [2] https://github.com/apache/groovy/commit/b48a51bbc57aded4754e1c3e277858632989e2d3