Skip to content

Reference: operator precedence

Normative implementation: crates/vox-compiler/src/parser/descent/expr/pratt_ops.rs (infix_bp and postfix ? handling).

Higher binding power means the operator groups more tightly with its operands.

Precedence (conceptual)Operators / formsNotes
1–2|> pipeLeft-associative chain: a |> f |> g
3–4orPhonetic logical OR
5–6andPhonetic logical AND
5–6with (expression form)Parsed as infix between operand and options block
7–8is, isnt, ==, !=Equality-style (EqEq / NotEq tokenized same as is / isnt)
9–10<, >, <=, >=Ordering comparisons
11–12+, -Arithmetic
13–14*, /, %Arithmetic multiplicative
Postfix (tight)?Try / early-return on Option / Result

Unary not and primary expressions are parsed before binary operators (see parser descent).

  • Prefix not applies to the following primary expression; combine with parentheses when mixing with and / or.