-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
handle operator associavity #75
handle operator associavity #75
Conversation
port of @oberblastmeister's changes from nix-community#35
|
64249e3
to
1eb2da1
Compare
1eb2da1
to
4e1b9ac
Compare
@nerdypepper SGTM, thanks 👍 . Just got a single question, after that it should be good to go :) |
Thanks for the review, this should be fixed now, do let me know if I should squash these or if they will will be squashed directly during merge. |
|
It should be used to parse operators such as |
@oberblastmeister according to https://nixos.org/manual/nix/stable/expressions/language-operators.html |
Yes, they are non-associative. The proper solution is to just not parse them, and have a parse error. |
OK, I should've checked more closely how what Nix actually expects. In fact, |
Yeah my bad, currently it parses it correctly. Also adding |
Port of @oberblastmeister's changes from #35, should hopefully fix #74. I haven't fully wrapped my head around the parser code, but I think the changes I have ported are correct as far as I have tested.
Summary & Motivation
An attempt to split changes from that #35 into more reviewable chunks.
Backwards-incompatible changes
Changes syntax trees generated for binary expressions using right-associative operators.
Further context
Previously, all operators were parsed as left associative, certain operators such as concat (
++
), merge (//
), and implication (->
) are now parsed as right associative: