-
Notifications
You must be signed in to change notification settings - Fork 428
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 error when parsing let x=-.1;
and co.
#1945
Conversation
let x=-.1;
and co.let x=-.1;
and co.
Now that I think of it, can you add a test to verify that |
Yeah I think I might have broken those. I'll add tests and make sure they're working. Thanks for the feedback |
This is actually trickier than I envisioned, and possibly even unsolvable. Imagine the following:
now what is really |
I think the answer to my question is infix precedence. I managed to fix this issue in the end and added some regression tests around it. This was definitely a tricky one, and I think we can make it work! |
@@ -353,18 +353,6 @@ let () = | |||
None | |||
) | |||
|
|||
(* To "unlex" a few characters *) | |||
let set_lexeme_length buf n = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's another one around line 190
Man I wish we can disable userland infix operator one day, and then provide a set of e.g. 5-10 good ones, whose precedence we can hard-code, and whose symbol won't be constrained by the first char. Anyway, is this diff ready? |
I really agree with that "first character" statement. Yeah this is ready to go. It's unfortunate that it complicates the grammar a little bit but both Iwan and I can't see another immediate way to support this case. |
3db1f1e
to
f89a4a0
Compare
This is a follow-up to reasonml#1642 employing the strategy highlighted in the following comment: reasonml#1642 (comment) It removes the special case around `LABEL_WITH_EQUAL`, making other valid inputs parseable too.
also add regression tests for these cases
f309e6d
to
29d1db1
Compare
Alright then, merging this one. Thanks for the hard work! Doesn't seem trivial |
This is a follow-up to #1642 employing the strategy highlighted in the following
comment: #1642 (comment)
It removes the special case around
LABEL_WITH_EQUAL
, making other valid inputsparseable too.
cc @IwanKaramazow