pub enum Expr {
Show 24 variants
Missing,
Bool(bool),
Int(i64),
Float(OrderedFloat<f64>),
String(String),
List(Vec<Node>),
Tuple(Vec<Node>),
Dict(Vec<(TokenKey, Node)>),
Spread(Node),
Comprehension {
element: Node,
id: String,
iterable: Node,
condition: Option<Node>,
},
Variable(Vec<TokenKey>),
Reference {
base: RefBase,
path: Vec<TokenKey>,
},
Binary(Operator, Node, Node),
Unary(Operator, Node),
Ternary {
cond: Node,
then: Node,
els: Node,
},
FnCall {
path: Vec<TokenKey>,
args: Vec<CallArg>,
},
FString(Vec<FStringPart>),
Type(TypeNode),
Wildcard,
Where {
expr: Node,
bindings: Node,
},
Match {
expr: Node,
arms: Vec<(Node, Node)>,
},
VariantPattern {
enum_path: Vec<String>,
variant: String,
bindings: Vec<PatternBinding>,
},
Closure {
params: Vec<ClosureParam>,
return_type: Option<TypeNode>,
body: Node,
},
VariantCtor {
enum_path: Vec<String>,
variant: String,
body: Node,
},
}Variants§
Missing
Internal placeholder for parse recovery or removed literals.
Bool(bool)
Int(i64)
Float(OrderedFloat<f64>)
String(String)
List(Vec<Node>)
Tuple(Vec<Node>)
Fixed-arity, heterogeneous, positional tuple value (e1, e2, ...).
Distinct from List so the analyzer can type it position-by-position
(heterogeneous elements allowed, unlike a list literal) and the
evaluator can preserve that distinction as Value::Tuple. JSON
output still projects it as a positional array.
Tuple(vec![]) is the unit / zero-tuple ().
Dict(Vec<(TokenKey, Node)>)
Spread(Node)
Comprehension
Variable(Vec<TokenKey>)
Reference
Binary(Operator, Node, Node)
Unary(Operator, Node)
Ternary
FnCall
FString(Vec<FStringPart>)
Type(TypeNode)
Wildcard
Where
Match
VariantPattern
Closure
VariantCtor
Tagged-enum variant constructor: EnumName.VariantName { field: value, ... }.
Unit variants share the bare-identifier-path form parsed as Variable
— the evaluator promotes them to a variant when the head resolves to
a sum-type schema.
Implementations§
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