pub struct Infix {
pub op: &'static str,
pub power: (u8, u8),
pub callee: &'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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Infix
impl RefUnwindSafe for Infix
impl Send for Infix
impl Sync for Infix
impl Unpin for Infix
impl UnsafeUnpin for Infix
impl UnwindSafe for Infix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more