pub enum ResolvedExpr {
Show 18 variants
Literal(Literal),
Ident(String),
Resolved {
slot: u16,
name: String,
last_use: AnnotBool,
},
Attr(Box<Spanned<ResolvedExpr>>, String),
Call(ResolvedCallee, Vec<Spanned<ResolvedExpr>>),
BinOp(BinOp, Box<Spanned<ResolvedExpr>>, Box<Spanned<ResolvedExpr>>),
Neg(Box<Spanned<ResolvedExpr>>),
Match {
subject: Box<Spanned<ResolvedExpr>>,
arms: Vec<ResolvedMatchArm>,
},
Ctor(ResolvedCtor, Vec<Spanned<ResolvedExpr>>),
ErrorProp(Box<Spanned<ResolvedExpr>>),
InterpolatedStr(Vec<ResolvedStrPart>),
List(Vec<Spanned<ResolvedExpr>>),
Tuple(Vec<Spanned<ResolvedExpr>>),
MapLiteral(Vec<(Spanned<ResolvedExpr>, Spanned<ResolvedExpr>)>),
RecordCreate {
type_id: Option<TypeId>,
type_name: String,
fields: Vec<(String, Spanned<ResolvedExpr>)>,
},
RecordUpdate {
type_id: Option<TypeId>,
type_name: String,
base: Box<Spanned<ResolvedExpr>>,
updates: Vec<(String, Spanned<ResolvedExpr>)>,
},
TailCall {
target: FnId,
args: Vec<Spanned<ResolvedExpr>>,
},
IndependentProduct(Vec<Spanned<ResolvedExpr>>, bool),
}Expand description
Resolved expression — the mechanical mirror of crate::ast::Expr.
Every variant that referenced a declared symbol by string in
Expr now carries its opaque ID. Variants that didn’t reference
any declaration pass through unchanged in shape.
Variants§
Literal(Literal)
Literal — untouched.
Ident(String)
Source-level identifier that the resolver pass could NOT
classify into a Resolved slot, a fn ref, or a constructor.
Typically a top-level / global binding name; backends look it
up in the post-resolve global table.
After full Phase E + D, this variant should rarely survive —
every name has either a slot, an FnId, a CtorId, or
fails to type-check. Kept here as the safety hatch during
migration.
Resolved
Compiled local-slot reference. Identical to Expr::Resolved
— the slot resolver runs before name-resolve and its output
is already typed identity.
Attr(Box<Spanned<ResolvedExpr>>, String)
Field / namespace projection. The object is recursively
resolved; the field name stays as source text because record
fields are scoped under their owning TypeId, not in a
global namespace.
Call(ResolvedCallee, Vec<Spanned<ResolvedExpr>>)
Function call — Expr::FnCall(callee, args) lifted into a
ResolvedCallee.
BinOp(BinOp, Box<Spanned<ResolvedExpr>>, Box<Spanned<ResolvedExpr>>)
Binary operator.
Neg(Box<Spanned<ResolvedExpr>>)
Unary minus.
Match
match subject { arm, … }.
Ctor(ResolvedCtor, Vec<Spanned<ResolvedExpr>>)
Constructor call — Result.Ok(v), Shape.Circle(r), etc.
ErrorProp(Box<Spanned<ResolvedExpr>>)
Result-error propagation: expr?.
InterpolatedStr(Vec<ResolvedStrPart>)
Interpolated string "a${x}b".
List(Vec<Spanned<ResolvedExpr>>)
[a, b, c] list literal.
Tuple(Vec<Spanned<ResolvedExpr>>)
(a, b, c) tuple literal.
MapLiteral(Vec<(Spanned<ResolvedExpr>, Spanned<ResolvedExpr>)>)
{"a" => 1, "b" => 2} map literal.
RecordCreate
Shape(name = "...", count = 0) record-create form. The
type_id is Some for user records resolved through the
symbol table, None for built-in record types (HttpResponse,
Header, Tcp.Connection, Buffer, …) which don’t carry
TypeIds by design.
Fields
type_name: StringSource-level type name kept verbatim for diagnostics +
backend codegen mangling. Mirrors Type::Named { name }.
fields: Vec<(String, Spanned<ResolvedExpr>)>RecordUpdate
Shape.update(base, field = newVal, …) record-update.
TailCall
Tail-position call (SCC peer). target is the FnId the
TCO transform pass committed to.
IndependentProduct(Vec<Spanned<ResolvedExpr>>, bool)
Independent product (a, b)! or (a, b)?!. unwrap toggles
the ?! form.
Trait Implementations§
Source§impl Clone for ResolvedExpr
impl Clone for ResolvedExpr
Source§fn clone(&self) -> ResolvedExpr
fn clone(&self) -> ResolvedExpr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedExpr
impl Debug for ResolvedExpr
Source§impl PartialEq for ResolvedExpr
impl PartialEq for ResolvedExpr
Source§fn eq(&self, other: &ResolvedExpr) -> bool
fn eq(&self, other: &ResolvedExpr) -> bool
self and other values to be equal, and is used by ==.