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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpecExpr
impl<'de> Deserialize<'de> for SpecExpr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for SpecExpr
Auto Trait Implementations§
impl Freeze for SpecExpr
impl RefUnwindSafe for SpecExpr
impl Send for SpecExpr
impl Sync for SpecExpr
impl Unpin for SpecExpr
impl UnsafeUnpin for SpecExpr
impl UnwindSafe for SpecExpr
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more