pub struct Infix {
pub op: &'static str,
pub power: (u8, u8),
pub callee: &'static str,
pub doc: &'static str,
}Expand description
What an infix operator binds like, and what it lowers to.
One row per operator, carrying both facts. Precedence and callee
used to live apart, and the cost was immediate: the surface spelling was
emitted verbatim, so a == b lowered to (== a b) — a symbol no
interpreter binds — and the program died at runtime with unbound symbol ==. Splitting the two invites exactly that: add an operator to
the precedence table, forget the lowering, ship a parse that cannot run.
Joined here, “has a precedence” and “has a callee” are the same fact.
Fields§
§op: &'static strSurface spelling.
power: (u8, u8)Left and right binding power. Higher binds tighter.
callee: &'static strThe tatara-lisp callee this lowers to.
doc: &'static strOne line for a reader: what the operator computes, and the trap in it
when there is one. blue reference prints it; a row without one fails
every_operator_and_keyword_is_described.