Skip to content

Operators

Lexer symbols come from SYMBOLS_1CHAR / SYMBOLS_2CHAR in the compiler. Logical connectives are keywords (and / or / not).

Category Tokens
Arithmetic + - * / %
Comparison == != < <= > >=
Assignment = += -= *= /=
Increment (stmt) ++ --

Unary - is used for negation. ++ / -- are statements only (e.g. C-style for update or i++ on its own line) — not expressions like x = i++.

Category Tokens
Call / group ( )
Index [ ]
Member .
Range (for-in only) ..
Lambdas (params) -> expr
Type / generics : < >
Function arrow ->
Match arm =>
Path / enum ::
Separators , ; { }

Shipped in Phase 1 ergonomics (tests/lang/phase1_ergonomics.vow):

Token Role
?? Null-coalesce (none_i ?? 99)
?. Optional member (Some("abc")?.len())
? Result propagate (prefer match in most examples)

match on Option / Result remains the most readable default for I/O errors.

// fragment-only
a and b
a or b
not a
  1. or
  2. and
  3. not
  4. == != < <= > >=
  5. + -
  6. * / %
  7. Primary: literals, names, calls, indexing, match, parenthesized expressions, struct literals, lambdas

No implicit conversion between numeric widths. Use as:

// fragment-only
let wide = n as int64;
let ratio = 0.5 as f64;
let shape = Shape::Circle(2) as dyn Shape;