pub enum Expr {
Show 17 variants
Literal(Literal),
Ident(String),
Attr(Box<Spanned<Expr>>, String),
FnCall(Box<Spanned<Expr>>, Vec<Spanned<Expr>>),
BinOp(BinOp, Box<Spanned<Expr>>, Box<Spanned<Expr>>),
Match {
subject: Box<Spanned<Expr>>,
arms: Vec<MatchArm>,
},
Constructor(String, Option<Box<Spanned<Expr>>>),
ErrorProp(Box<Spanned<Expr>>),
InterpolatedStr(Vec<StrPart>),
List(Vec<Spanned<Expr>>),
Tuple(Vec<Spanned<Expr>>),
MapLiteral(Vec<(Spanned<Expr>, Spanned<Expr>)>),
RecordCreate {
type_name: String,
fields: Vec<(String, Spanned<Expr>)>,
},
RecordUpdate {
type_name: String,
base: Box<Spanned<Expr>>,
updates: Vec<(String, Spanned<Expr>)>,
},
TailCall(Box<TailCallData>),
IndependentProduct(Vec<Spanned<Expr>>, bool),
Resolved {
slot: u16,
name: String,
last_use: AnnotBool,
},
}Variants§
Literal(Literal)
Ident(String)
Attr(Box<Spanned<Expr>>, String)
FnCall(Box<Spanned<Expr>>, Vec<Spanned<Expr>>)
BinOp(BinOp, Box<Spanned<Expr>>, Box<Spanned<Expr>>)
Match
Constructor(String, Option<Box<Spanned<Expr>>>)
ErrorProp(Box<Spanned<Expr>>)
InterpolatedStr(Vec<StrPart>)
List(Vec<Spanned<Expr>>)
Tuple(Vec<Spanned<Expr>>)
MapLiteral(Vec<(Spanned<Expr>, Spanned<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<TailCallData>)
Tail-position call to a function in the same SCC (self or mutual recursion).
Produced by the TCO transform pass before type-checking.
Reuse info is populated by ir::reuse::annotate_program_reuse.
IndependentProduct(Vec<Spanned<Expr>>, bool)
Independent product: (a, b, c)! or (a, b, c)?!.
Elements are independent effectful expressions evaluated with no guaranteed order.
unwrap=true (?!): all elements must be Result; unwraps Ok values, propagates first Err.
unwrap=false (!): returns raw tuple of results.
Produces a replay group (effects matched by branch_path + effect_occurrence + type + args).
Resolved
Compiled variable lookup: env[last][slot] — O(1) instead of HashMap scan.
Produced by the resolver pass for locals inside function bodies.
last_use is set by ir::last_use — when true, this is the final
reference to this slot and backends can move instead of copy.