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

reduce/resuce precedence #51

Closed
wants to merge 2 commits into from

Conversation

mrgleba
Copy link
Contributor

@mrgleba mrgleba commented Mar 23, 2016

Path to address:
#40

Some discussion in my previous PR:
#47

Closes #40

@mrgleba
Copy link
Contributor Author

mrgleba commented Mar 23, 2016

I'd like to add that this is a potentially breaking change (there could be parsers generated differently after the patch). I would appreciate someone's second opinion.

@kkm000
Copy link
Member

kkm000 commented Mar 26, 2016

Thanks for the fix, LGTM. For its being potentially breaking, I believe it should be ok--the users have been warned about the conflict, and then a reduce/reduce conflict is always a thing to take seriously. Also, the next version is going to be 7.0, indicating some breaking would be expected.

It would be awesome if you added a test with the grammar from #40. Can you find time to add that?

@kkm000 kkm000 added this to the 7.0 milestone Mar 26, 2016
@dsyme
Copy link
Contributor

dsyme commented Mar 30, 2016

Please, please add a command line option to optionally preserve the exact old behaviour.

Maintainers: please don't accept this PR until this command line flag is added :)

This is to ensure that any downstream users get complete control over whether they adopt this change or not, "just in case".

Thank you!

@dsyme
Copy link
Contributor

dsyme commented Mar 30, 2016

@enricosada Please note that the F# compiler repo would need to apply this flag, at least in a first instance until a thorough impact analysis has been done

@mrgleba
Copy link
Contributor Author

mrgleba commented Mar 30, 2016

I'll try to extend this PR to address #39 too.
I'll create a command line option that would allow to persist current behaviour in both cases (reduce/reduce and shift/reduce on nonassoc).

@dsyme
Copy link
Contributor

dsyme commented Mar 30, 2016

Thanks!

@mrgleba
Copy link
Contributor Author

mrgleba commented Mar 30, 2016

I've added a new PR with both fixes and a command line option to preserve previous behaviour.
Please do not merge yet. I'd still like to investigate a thing or two here.

@kkm000 kkm000 changed the title reduce/resuce precedence WIP: reduce/resuce precedence Mar 31, 2016
@kkm000
Copy link
Member

kkm000 commented Mar 31, 2016

Thanks!

Normally, you'd put "WIP" into the title of the PR to indicate it is work in progress and not to be merged.

@mrgleba
Copy link
Contributor Author

mrgleba commented Apr 8, 2016

I've looked into the way fsyacc tries to do error recovery.
In most cases this would propagate error up the state stack.
In other cases this would accept an invalid input
The before mentioned example of nonassoc operator is an example of the latter.
Another case is the possibility to accept (fnish parsing) before reaching EOF.

I'd vote to remove his behaviour. If someone needs it, it's still available with the new --oldprec option.
Alternatively I can and another option to control this behaviour.
I'd preferr the former, but I'll gladly hear your opinion.

I'll try to find time to add some tests to this commit and get back to you to merge the whole PR.

2 arguments to control the behavior:
--newprec - enable new calculation mode (disabled by default to preserve
compatibility)
--no-recovery - don't try to reduce as a fallback from invalid input
@mrgleba mrgleba changed the title WIP: reduce/resuce precedence reduce/resuce precedence May 30, 2016
@mrgleba
Copy link
Contributor Author

mrgleba commented May 30, 2016

I've finally found some time to get back to these changes.
The new commit has 2 command line args:
--newprec - to ebable new precedence calculation mode
--no-recovery - to disable reduction as a mode of receoverying from invalid input

With neither of the above fsyacc would work as previously (the overal change is not-breaking - you have to opt-in to get the new functionality).

@dsyme
Copy link
Contributor

dsyme commented Apr 10, 2019

Closing this old PR

@dsyme dsyme closed this Apr 10, 2019
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.

3 participants