inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.14k stars 493 forks source link

logical operators precedence #844

Open premek opened 1 year ago

premek commented 1 year ago

is logical operators (and, or, &&, ||) precedence intentionally the same? Left to right? I think usually 'and' has higher precedence than 'or'. But maybe left to right is more intuitive for non-programmers?

Example:

ink:

{ true or false and false }
{ false and false or true}

out:

false
true

while for example in JS:

> true || false && false
true
> false && false || true
true