Skip to main content

Module operators

Module operators 

Source
Expand description

Operator table DATA — token → operator-name mappings grouped by ISO precedence level, kept separate from the precedence-climbing logic in [super::term].

This is deliberately pure data (plus trivial lookups over it) so the M2 runtime’s minimal goal parser can share the same table without dragging in the full parser. Each &str here is the atom name the operator interns to.

Functions§

op_400
Precedence-400 left-associative (yfx) operators: * / // mod rem div << >>.
op_500
Precedence-500 left-associative (yfx) operators: + - /\ \/ xor.
op_700
Precedence-700 non-associative operators (is, =, comparisons, term ordering). Maps a fixed-kind token to its operator atom name. The “word” operators that arrive as Atom(..) tokens (@<, =.., …) are handled by word_op_700.
op_as_atom
Operator name for an operator token appearing in atom position (issue #19): p(+), [<, >], X = (mod), =.. round-trips, etc. This is the superset of all infix/prefix operator spellings.
word_op_700
Precedence-700 operators that the tokenizer emits as bare atoms (@<, @>, @=<, @>=, =..). Returns the canonical name when s is one of them.