pub enum SpecExpr {
Var {
name: String,
},
IntLit {
value: i64,
},
FloatLit {
value: f64,
},
BoolLit {
value: bool,
},
StrLit {
value: String,
},
Call {
func: String,
args: Vec<SpecExpr>,
},
Let {
name: String,
value: Box<SpecExpr>,
body: Box<SpecExpr>,
},
BinOp {
op: SpecOp,
lhs: Box<SpecExpr>,
rhs: Box<SpecExpr>,
},
Not {
expr: Box<SpecExpr>,
},
FieldAccess {
value: Box<SpecExpr>,
field: String,
},
Index {
list: Box<SpecExpr>,
index: Box<SpecExpr>,
},
Match {
scrutinee: Box<SpecExpr>,
arms: Vec<MatchArm>,
},
}Variants§
Var
IntLit
FloatLit
BoolLit
StrLit
Call
A call into the target Lex function (or another helper).
Let
BinOp
Not
FieldAccess
Field access on a record-typed expression (#208). Evaluated by
drilling into Value::Record’s field map; fails-loudly if the
underlying value isn’t a record or doesn’t contain the field.
Index
Indexed access on a list-typed expression (#208). xs[i]
evaluates to the i-th element of the list (zero-based).
Out-of-bounds indices fail loudly via Inconclusive — agents
that want defensive behavior wrap with a length(xs) > i
check.
Match
Pattern match on a sum-typed expression (#208 slice 3). Arms
are tried in order; the first matching arm’s body is the
result. A _ wildcard pattern is exhaustive. Variant
patterns (Charge(x)) bind positional args by name in the
arm’s body. Non-exhaustive matches fall through to
Inconclusive at evaluation time.