Really (this time) no reduce/reduce conflicts in grammar #68
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.
Last time, when I converted the right recursion in
one_or_more_semis
to left recursion, I accidentally introduced another R/R conflict! Sorry!In the diff below, you can see an adjustment involving
optional_space
; this one caused a conflict because it can be null, andany_number_of_idents
can also be null, so if there is a space but no "idents", the parser won't know if the space should be consumed by the first instance ofoptional_space
or the second.Similarly with
one_or_more_semis
-- there were several redundant rules fordeclarations
, and if there were semis there, there was more than one way that the rules could be applied to parse them. Now there is only ever one way that thedeclarations
rules can be applied.(I'm just working on the 2.0 release of Racc, and have added much better warnings, which show you just where Racc has difficulty with your grammar. This is how I found these. There are still 3 S/R conflicts, which I may figure out how to fix later.)