-
Notifications
You must be signed in to change notification settings - Fork 17
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
Logical operators and conditional statements (if/else) get compiled wrongly #32
Comments
Update: figured out a bit more about this
compiles as
when it actually should be
from this you can see, that it sorts the operators ( now about conditional operators (if/else):
compiles as
when it actually should be
from this you can see, that the hope this update helps you to fix these! |
Thanks for posting this. I often noticed that the boolean parsing is not quite right. And actually made a way better implementation of it in objd. But in fact mcscript was never supposed to do this that way. It should give a slight syntax variation of the minecraft commands and in the process it also inherited the problems with if and unless. I understand that one might expect this behaving differently, but I honestly have not the time and motivation to rewrite anything to fix this big issue. |
The compiler assumes that an
else
statement afterif(!condition1 && !condition2)
isif(condition1 && condition2)
, when in reality it should beif(condition1 || condition2)
(akaif(!(!condition1 && !condition2))
which mcscript doesn't seem to support)Example, should kill a dropped item if it has a block of gold 1 or 2 blocks below it and set the block at it's current position to a red banner otherwise, but it will instead kill it only when both blocks are blocks of gold:
The text was updated successfully, but these errors were encountered: