Repository navigation
Conversation
This branch has not been deployed
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.
IELR uses annotations to decide whether two states can share a parser action. When a shift conflicts with multiple reductions, the annotation could keep comparing the shift after discarding it, or treat a
%nonassocerror as a surviving reduction. In the regression grammar this merged two states:x+should be a syntax error, butax+should be accepted.Compare reductions in grammar rule order, as parser table construction does. Stop when a reduction discards the shift. Return an empty action set for an explicit nonassociative error so state compatibility can distinguish it from a missing contribution.
The generated parser agrees with Bison IELR and canonical LR on all 9,841 inputs over the grammar's three tokens through length eight. Across 6,144 combinations of precedence, associativity and action order, mismatches between annotations and parser table conflict resolution fall from 1,992 to zero.
Measured on Ruby 4.0.9, arm64 macOS, with YJIT disabled. Each mode used 12 paired runs of master (5d79308) and this change (d12d419) in balanced, randomized order.
The paired change in CLI time on Ruby's
parse.ywas +1.07% (bootstrap 95% CI −0.24% to +2.57%). Warm allocations fell by 2.36%. On a synthetic grammar with many state splits, CLI time rose by 4.68% in the first block and 2.49% in a repeat (repeat 95% CI −0.13% to +5.41%).