Skip to content
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

Give more descriptive warnings on shift/reduce conflicts #47

Merged
merged 1 commit into from
Mar 23, 2016

Conversation

mrgleba
Copy link
Contributor

@mrgleba mrgleba commented Mar 23, 2016

Give more detail about shift/reduce and reduce/reduce and state explicitely which is eventually chosen.

Give extra info in warning when we have a shift/reduce on an explicitely nonassoc.

@dsyme dsyme merged commit 5934923 into fsprojects:master Mar 23, 2016
@dsyme
Copy link
Contributor

dsyme commented Mar 23, 2016

Thanks!

@kkm000
Copy link
Member

kkm000 commented Mar 23, 2016

@dsyme, @mrgleba, is this related to/fixes/addresses #39 and #40? I know too little not only to fix these issues, but also to even understand the problem.

@mrgleba
Copy link
Contributor Author

mrgleba commented Mar 23, 2016

Well, the commit doesn't alter the parser in any way it only improves the way the conflicts are reported.
It's generally a non-breaking change. The generated parser itself is not changed in any way.

As regards #39:
Using a nonnasoc in this way is rather bogus. Generally arithmetics and logics are done in their own rules. IMHO accomodating FsLexyacc to accept this beahviour would be doing a lot of work (and I mean wild changes in the construction of the automaton) just to allow bad beahviour. Unless there is a really compelling exaplce to the contrary I believe this is a clear WontFix.

#40 is a horse of a whole diferent colour.
Right now in fslexyacc rule precedence is determined by

  • %prec TERMINAL if given
    • last TERMINAL (ie token rather than clause) in the rule

Rule precedence as of now are used in shift/reduce conflicts and completely ignored in reduce/reduce where the rule earlier in the file wins. This is IMHO a bug.
I'll make a pull request with a patch in a minute and we can discuss that there.

@TorbenMogensen
Copy link

See my comments on #39 for why I disagree that the proposed change is "bogus". Note that I don't have privileges to reopen #39, so I ask someone who can to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants