Operators

Operators are applied to data values, or combine several data values (e.g. "1 + 1"). When an expression contains multiple operators the operators are applied in sequence according to a standard set of rules of operator precedence. The table below contains the available operators listed in order of precedence (for example, in the expression "1 + 2 * 3" the multiplication will occur before the addition). Where several identical operators occur in a row they are evaluated from left to right. Parentheses may be used to explicitly control the order of evaluation (e.g. "(1 + 2) * 3").

Some of the operators have several aliases. For example the relational 'less than' operator can be represented by the symbols 'lt' or '<', with no difference between these two usages. Capitalization does not matter in operator symbols and function names ('AND' is the same as 'And'). An expression may be composed of several sub-expressions, each separated by the semicolon (;) character. The sub-expressions will be evaluated in sequence, and the returned value of the expression will be the value of the final sub-expression. Values produced by the initial sub-expressions will be discarded, however these sub-expressions may have side effects (e.g. the setVar() function) that influence subsequent sub-expressions.

OperatorSyntax
Logical ‘or’

<bool> || <bool>

<bool> or <bool>

Logical ‘and’

<bool> && <bool>

<bool> and <bool>

Binary ‘or’<int> | <int>
Binary ‘xor’<int> ^ <int>
Binary ‘and’<int> & <int>
Equality

<value> = <value>

<value> == <value>

<value> eq <value>

Inequality

<value> != <value>

<value> ne <value>

in<value> in <list>
Relational

<value> op <value>

where op can be

< or lt

<= or le

> or gt

>= or ge

Bit shift

<int> >> <int>

<int> >>> <int>

<int> << <int>

Concatenation<string> + <value>
Summation

<value> + <value>

<value> - <value>

Product

<value> * <value> multiplication

<value> / <value> division

<value> % <value> modulus

Negation- <value>
Logical not

not <bool>

! <bool>

Bitwise complement~ <integer>