Operators
Lexer symbols come from SYMBOLS_1CHAR / SYMBOLS_2CHAR in the compiler. Logical connectives are keywords (and / or / not).
Arithmetic, comparison, assignment
Section titled “Arithmetic, comparison, assignment”| 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++.
Calls, members, types, match
Section titled “Calls, members, types, match”| Category | Tokens |
|---|---|
| Call / group | ( ) |
| Index | [ ] |
| Member | . |
| Range (for-in only) | .. |
| Lambdas | (params) -> expr |
| Type / generics | : < > |
| Function arrow | -> |
| Match arm | => |
| Path / enum | :: |
| Separators | , ; { } |
Option / Result sugar
Section titled “Option / Result sugar”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.
Logical operators
Section titled “Logical operators”// fragment-onlya and ba or bnot aPrecedence (low → high)
Section titled “Precedence (low → high)”orandnot==!=<<=>>=+-*/%- Primary: literals, names, calls, indexing,
match, parenthesized expressions, struct literals, lambdas
No implicit conversion between numeric widths. Use as:
// fragment-onlylet wide = n as int64;let ratio = 0.5 as f64;let shape = Shape::Circle(2) as dyn Shape;