-
Notifications
You must be signed in to change notification settings - Fork 199
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
Unary +
precedence
#1016
Comments
You must note that this is particular to integer constants. OTOH, there does indeed seem to be a bug in the result from Note that this is only the case with integer literals:
|
I believe this will be a problem with any number constants, not just integers. |
Sorry, I did mean number, you are correct. |
Thanks for reporting. Does this bug (or #1017) impact Prism's test suite? If not I'll fix it "later", nobody else seems to need it. |
Thanks @iliabylich no rush at all, I'm just excluding those tests from the test suite that compares the AST translation. So it's no rush. |
There are two issues with unary
+
precedence that I can find.The first is that the parser is creating a
send
node, when there isn't really going to be a method call. This is, for example:As you can see, the space affects the result. If there is no space, then no method call is generated. However, in both cases you get the same AST:
The other issue is that the precedence in this AST is incorrect in both cases. This is implying that the expression should be parsed as:
but in reality, in both cases it should be parsed as:
The text was updated successfully, but these errors were encountered: