From Lua manual:
Both
and
andor
use short-cut evaluation; that is, the second operand is evaluated only if necessary.
So in the expression condition1 and (condition2 or condition3)
, condition2 or condition3
is only evaluated if condition1
is true.
Note that this also means in the expression condition2 or condition3
, condition3
is only evaluated if condition2
is false.