-
Notifications
You must be signed in to change notification settings - Fork 931
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
Subtracting float from product requires parentheses #4445
Comments
Strangely subtracting does work when you add whitespace after the minus sign:
|
parser preferred to parse the negative number, instead of expecting an operator or close paren? maybe the tokenizer isn't aware of the grammar context? |
This is apparently per spec:
This is considered a bug in the spec, but it hasn't been fixed yet. |
For the record, the general plan is to let constant expression folding handle the negation, so There's a wrinkle: the largest negative Since the behavior reported is per spec, I'll close this bug. |
The spec issue has been resolved, reopening. We should be able to tackle this once the const-expressions work lands. |
The following passes with #4870:
|
It looks like using a minus sign in an "additive_expression" wrapped in a "paren_expression" results in a parser error
This confused me for a while, and from what I understand from the grammar it should be allowed.
To reproduce this you can run this fragment shader with my slimshader or any such tool:
The text was updated successfully, but these errors were encountered: