-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict handling #5
base: master
Are you sure you want to change the base?
Conversation
Removed clippy warnings and applied rustfmt
Hi @goffrie, Since I need these changes for my own project I'm now in a difficult sitiuation. Greetings |
I've been working on a more general solution for how to control the handling of conflicts during parse table generation.
The original implementation already provided two parameters
reduce_on
andpriority_of
that could properly resolve any conflicts.However, the problem with automatic parser generators is that it is not easy to describe which conflicts should be solved automatically and which should not.
I therefore wanted a way to create behavior like YACC, namely that in general all shift-reduce conflicts can be resolved by favoring shift.
In order not to inflate the call parameters of the
lalr
function excessively, I introduced aConfig
trait that allows the configuration of the behavior.The previous functions
reduce_on
andpriority_of
are now part of this trait and ensure that the previous functionality is retained. TheConfig
trait allows further configuration options, such as the YACC-like behavior described above. You can also configure whether such automatically resolved conflicts shall be reported as warnings.I have provided tests for all new functionality.
I hope these extensions fit into the general concept of this crate. In any case, I am convinced that the expanded configuration options can appeal to more users.