Operator precedence (Vitte 1.0)
This table corresponds to the current parser in src/compiler/frontend/parser.vit. The tallest lines have the strongest bond.
- Postfix: call
f(x), indexa[b], membera.b, deref postfixa.* - Unary:
not/!, unary-, address&, deref* - Cast:
as - Multiplicative:
*/% - Additive:
+- - Shift:
<<>> - Relational:
<<=>>= - Equality:
==!=and pattern testis - Bitwise AND:
& - Bitwise XOR:
^ - Bitwise OR:
| - Logical AND:
and&& - Logical OR:
or|| - Assignment:
=
Notes:
asis parsed before any binary operator, so it binds stronger than comparisons and arithmetic.isis treated at the same priority level as equality.- The assignment is right-associative (
a = b = cis parsed asa = (b = c)).