Language Reference

Operators and Punctuation

The current token inventory, operator roles, and expression precedence.

Raz Gen2 Manual·Language Reference

Operator token numbers are implementation identifiers in the current lexer. They are not stable source-level API and may be centralized or generated later.

Operators

Spelling Token ID Current role
= 30 Binding initialization and assignment statement
+, - 31, 32 Arithmetic; also unary plus/minus
*, /, % 33–35 Multiplication, division, remainder; * also occurs in pointer type syntax
! 36 Logical negation; a suffix on a bare name followed by call parentheses marks a native call
==, != 37, 38 Equality and inequality
<, <=, >, >= 39–42 Ordered comparison; angle brackets are also used in generic type syntax
&&, || 43, 44 Boolean conjunction and disjunction; short-circuit behavior has tests
-> 45 Function return-type separator, including function types; not a general expression operator

Punctuation and delimiters

Spelling Token ID Role
(, ) 20, 21 Group expressions; delimit function parameters and call arguments
{, } 22, 23 Delimit blocks and declaration bodies
; 24 Statement/directive terminator; optionality depends on construct
: 25 Separates a name from its declared type
, 26 Separates parameters, arguments, fields, or list items where permitted
. 27 Member access and dotted module names in source directives
[, ] 28, 29 List literals and indexed access

Current binary precedence

From lowest to highest, the parser currently groups binary operators as follows:

  1. ||
  2. &&
  3. ==, !=
  4. <, <=, >, >=
  5. +, -
  6. *, /, %
Specification needed: precedence is visible in the parser, but the normative grammar, associativity, and implicit-conversion rules have not been fully approved. The arrow token -> is used for type syntax, not as a binary operator.