Skip to content

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

Open
br0nstein wants to merge 1 commit into
tunnelvisionlabs:masterfrom
br0nstein:master
Open

Do not explore beyond rule stop states when computing possible next tokens during error recovery#85
br0nstein wants to merge 1 commit into
tunnelvisionlabs:masterfrom
br0nstein:master

Conversation

@br0nstein

Copy link
Copy Markdown

Fixes #84

@br0nstein

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Author

@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

KvanTTT commented Nov 6, 2023

Copy link
Copy Markdown
Contributor

If this optimized fork is still maintained.

I'm afraid it's not.

@daniellansun

Copy link
Copy Markdown
Contributor

@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] daniellansun@0e8c76e
[2] apache/groovy@b48a51b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error recovery does not work correctly for grammars that contain fully-optional rule bodies.

3 participants