You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
results in -2. The expected result is -.5. You can see this with a new empty project with only this statement:
echo(2 / -2 / 2);
We believe what happens is the expression is evaluated right-to-left, where you first have 2 / 2 from the right side (resulting in 1), then the - operator is applied (now -1), and finally the leading division (2 / -1) becomes -2. Or perhaps it works left-to-right where the bug is the first / operator trying to resolve the right-hand side to an integer.
What should happen is the lexer should see the inner -2 as the same token, so you have a single literal -2 value hit the parser.
The text was updated successfully, but these errors were encountered:
As first seen here:
This expression:
results in
-2
. The expected result is-.5
. You can see this with a new empty project with only this statement:We believe what happens is the expression is evaluated right-to-left, where you first have
2 / 2
from the right side (resulting in1
), then the-
operator is applied (now-1
), and finally the leading division (2 / -1
) becomes-2
. Or perhaps it works left-to-right where the bug is the first/
operator trying to resolve the right-hand side to an integer.What should happen is the lexer should see the inner
-2
as the same token, so you have a single literal-2
value hit the parser.The text was updated successfully, but these errors were encountered: