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

Fix reduce/reduce conflict #126

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Fix reduce/reduce conflict #126

merged 1 commit into from
Jan 20, 2025

Conversation

liam923
Copy link
Contributor

@liam923 liam923 commented Jan 20, 2025

#124 introduced a reduce/reduce conflict to the parser. Although menhir raised a warning, it did not report it as an error. So I didn't notice the issue until importing the changes to our internal codebase. The conflict was simple: a new rule for parsing _ in an overwrite statement conflicted with Merlin's existing parser support for _s as typed holes.

@liam923 liam923 requested a review from goldfirere January 20, 2025 15:30
@liam923
Copy link
Contributor Author

liam923 commented Jan 20, 2025

I looked at Menhir's docs, and there isn't an easy way to raise the level of the warning to an error. There is a --strict flag that seems to report all warnings as an error, but there are other existing warnings:

File "src/ocaml/preprocess/parser_raw.mly", line 1162, characters 29-36:
Warning: the token COMMENT is unused.
File "src/ocaml/preprocess/parser_raw.mly", line 1163, characters 30-39:
Warning: the token DOCSTRING is unused.
File "src/ocaml/preprocess/parser_raw.mly", line 1165, characters 7-10:
Warning: the token EOL is unused.
File "src/ocaml/preprocess/parser_raw.mly", line 1060, characters 7-22:
Warning: the token GREATERRBRACKET is unused.
File "src/ocaml/preprocess/parser_raw.mly", line 1235, characters 0-9:
Warning: the precedence level assigned to GREATERDOT is never useful.

So an option would be to use --strict and either fix or ignore those warnings.

@liam923 liam923 merged commit 0514f08 into main Jan 20, 2025
1 of 2 checks passed
@liam923 liam923 deleted the fix-reduce-reduce-conflict branch January 20, 2025 16:31
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.

2 participants