Repository navigation
Parser reductions - #4475
Merged
Merged
Parser reductions#4475
Conversation
This wraps the node returned by parse_expression* to contains just the node itself at the moment. This is to set up being able to track which kind of reduction was produced, in order to properly exit the pratt loop on stmt or expr reductions that should not be followed by things like modifiers.
When parsing a yield, if it has no parentheses and it has arguments then it counts as a command, which is higher up in the grammar. It cannot be combined with modifiers, so we need to exit the pratt loop.
stevenjohnstone
added a commit
to stevenjohnstone/prism-fuzzer
that referenced
this pull request
Nov 24, 2026
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 a node is returned from a parsing function, instead of returning the raw node we're going to wrap it in a struct with an enum telling us what kind of reduction produced that node. That allows us to figure out when we need to break out of the pratt loop without having to look at the node itself and guess. This also lets us model the stmts/expr/arg split in parse.y much more faithfully.
Fixes #4463
Fixes #4464
Fixes #4465
Fixes #4466
Fixes #4467
Fixes #4468
Fixes #4469
Fixes #4470
Fixes #4471
Fixes #4472
Fixes #4473
Fixes #4474
Closes #4380