pub enum Expr {
Show 17 variants
Literal(Literal),
Ident(String),
Attr(Box<Expr>, String),
FnCall(Box<Expr>, Vec<Expr>),
BinOp(BinOp, Box<Expr>, Box<Expr>),
Match {
subject: Box<Expr>,
arms: Vec<MatchArm>,
line: usize,
},
Pipe(Box<Expr>, Box<Expr>),
Constructor(String, Option<Box<Expr>>),
ErrorProp(Box<Expr>),
InterpolatedStr(Vec<StrPart>),
List(Vec<Expr>),
Tuple(Vec<Expr>),
MapLiteral(Vec<(Expr, Expr)>),
RecordCreate {
type_name: String,
fields: Vec<(String, Expr)>,
},
RecordUpdate {
type_name: String,
base: Box<Expr>,
updates: Vec<(String, Expr)>,
},
TailCall(Box<(String, Vec<Expr>)>),
Resolved(u16),
}Variants§
Literal(Literal)
Ident(String)
Attr(Box<Expr>, String)
FnCall(Box<Expr>, Vec<Expr>)
BinOp(BinOp, Box<Expr>, Box<Expr>)
Match
Pipe(Box<Expr>, Box<Expr>)
Constructor(String, Option<Box<Expr>>)
ErrorProp(Box<Expr>)
InterpolatedStr(Vec<StrPart>)
List(Vec<Expr>)
Tuple(Vec<Expr>)
MapLiteral(Vec<(Expr, Expr)>)
Map literal: {"a" => 1, "b" => 2}
RecordCreate
Record creation: User(name = "Alice", age = 30)
RecordUpdate
Record update: User.update(base, field = newVal, ...)
TailCall(Box<(String, Vec<Expr>)>)
Tail-position call to a function in the same SCC (self or mutual recursion). Produced by the TCO transform pass before type-checking. Boxed to keep Expr enum at its original size (48 bytes).
Resolved(u16)
Compiled variable lookup: env[last][slot] — O(1) instead of HashMap scan.
Produced by the resolver pass for locals inside function bodies.
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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