-
Notifications
You must be signed in to change notification settings - Fork 35
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
Weird Operator Behavior #511
Comments
Fair point; that definitely seems confusing. We currently allow binary operators at starts of lines to continue lines. For example: x := 5
- x
or y
---
const x = 5 - x || y I think this makes sense for symbol operators, and probably other built-in operators like Perhaps custom operators should allow this only when they are min 1, 2
min 1, 2 |
I don't think it makes sense for our current custom operators since they are not infix, but it could make sense if they were. |
What do you mean that they're not infix? |
You're correct, I had a moment of confusion. The optionally infix is what I think this makes this behavior weird. I can see allowing your example of using min 1, 2
min 1, 2 Has this as a sensible parse: min(1, min(2
1), 2) min 1, 2
min 1, 2 Should parse like this: min(1, 2)
min(1, 2) |
Becomes:
It should be:
Adding semi-colons or assignments fixes it.
https://civet.dev/playground?code=b3BlcmF0b3IgbWluCgptaW4gMSwgMgptaW4gMSwgMg%3D%3D
The text was updated successfully, but these errors were encountered: