-
Notifications
You must be signed in to change notification settings - Fork 2k
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
X +Y gets compiled to X(+Y) #2686
Comments
Which is expected in a whitespace-sensitive language. |
According to which grammar rule? And why should Math.sqrt(2) +Math.sqrt(3) get compiled like that while 2 +Math.sqrt(2) gets compiled in a different way? |
Grammar rule ? Implicit call. And |
The grammar is here: |
Yes, but implicit calls are rewritten before |
OK, thanks. So +/- are parsed as unary operator without the space. |
@Kambis: please read the duplicates that came before this. Also, |
To be more specific ... It's useful to keep the consistency for things like this:
... and so on. |
Some expression of the type X +Y like
Math.sqrt(2) +Math.sqrt(3)
with a space before the + but not after get compiled to
Math.sqrt(2)(+Math.sqrt(3));
which are not meaningful.
The text was updated successfully, but these errors were encountered: