Repository navigation
Compute initial IELR lookaheads in item dependency order - #879
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When predecessor states form a cycle, Lrama could read an unfinished item's lookahead as an empty set. This made the generated IELR parser reject valid input such as
caadin the regression grammar.Compute each item's lookahead after the items it depends on. Each predecessor item has its dot one position earlier in the same rule, so processing the collected items in increasing dot position also handles recursive grammars.
On the regression grammar, the generated parser agrees with Bison 3.8.2's IELR and canonical LR parsers on every input over a–d through length seven. Ruby's
parse.yproduces identical C and--report=alloutput.Measured on Ruby 4.0.9, arm64 macOS, with YJIT disabled. Each timing block used 12 paired runs in balanced, randomized order.
The paired CLI slowdown was 4.18% in the first block (bootstrap 95% CI +1.86% to +6.88%) and 1.73% in the repeat (−0.55% to +4.11%). The corrected lookaheads produce 37,885 annotations for
parse.y, up from 36,583.