Buy Now

Expression Operator Precedence

< Previous | Contents | Manuals Home | Boris FX | Next >

โ€ŒExpression Operator Precedence

Sizzle uses a simplified operator precedence, especially compared to C++. The precedences have been adjusted to make embedding script in boilerplate easy. The operators are listed from highest to lowest.


Terms (expr), [index], ob.attr, function calls, #ob,

$indirection

Autoincrements ++x, --x, x++, xโ€”

Powers x**2

Negations -x, ~x

Multiplications x*y, x/y, x%y, x&y, x^y, x<<y, x>>y

Additions x+y, x-y, x|y

Selection (q ? x : y)

Relations x<y, x>y, x==y, x!=y, x<=y, x>=y

Boolean Negate !(x==3)

Boolean And x>y && y>z

Boolean Or x==5 || y>3

Assignments x=y, x+= y, x -= y, x *= y, x /= y, x &= y, x |= y, x ^= y

Concatenation โ€œaโ€ x=โ€bโ€ 2+3 x produces โ€œa5bโ€


All numbers are 64-bit floating point, but hexadecimal constants, logical shifts, and booleans are treated as 32-bit integers.

Note that the assignment operators do not produce output to the file, as in the concatenation example above. The mini-script @[x=โ€Hiโ€ โ€œthereโ€]@ writes โ€œthereโ€ (without the quotes) to the output file, assigning โ€œHiโ€ to the variable x. This is because concatenation is lower in the precedence table than assignment, so the assignment โ€œ=โ€ binds only to โ€œHiโ€. If you wanted x to be โ€œHi Thereโ€, you would write [@x=(โ€œHiโ€ โ€œThereโ€)]@, which would output nothing. Though this means you need parentheses for this example, the precedence above eliminates the need to end each line with a semicolon or end of line.

ยฉ2026 Boris FX, Inc.ย โ€”ย UNOFFICIALย โ€”ย Converted from original PDF.


Subscribe to our newsletter

Get all the latest news, blog posts and product updates from Boris FX, delivered directly to your inbox.

In order to provide you with the content requested, we need to store and process your personal data. For more information on how to unsubscribe and our commitment to protecting your privacy, please review our Privacy Policy.

Welcome!

Thanks for opting-in to our newsletter. You'll receive an email momentarily with your confirmation.

Please select your language

The website is currently localized into the following languages