pub enum Expr {
Show 16 variants
Literal(Value),
Var(String),
Env(String),
KeyPath {
base: String,
keys: Vec<String>,
},
List(Vec<Expr>),
Map(Vec<(String, Expr)>),
Block(Vec<Step>),
Call {
name: String,
args: Vec<Expr>,
},
Inspect(String),
Compare {
op: CompareOp,
left: Box<Expr>,
right: Box<Expr>,
},
Arithmetic {
op: ArithOp,
left: Box<Expr>,
right: Box<Expr>,
},
CompiledMath(Vec<MathOp>),
FreshPipe,
UnsignedIntBoundary(u64),
Not(Box<Expr>),
Logical {
op: LogicalOp,
left: Box<Expr>,
right: Box<Expr>,
},
}Variants§
Literal(Value)
Var(String)
Env(String)
Environment read (env:KEY): resolves against the script
environment at evaluation time.
KeyPath
List(Vec<Expr>)
Map(Vec<(String, Expr)>)
Block(Vec<Step>)
Inline block (LET $a: STRING = { RETURN "hi" }): runs its steps in
a fresh scope when evaluated and yields the RETURN value
(fallthrough yields "", mirroring a zero-arg function body).
Parsed only where map_literal fails, so {k: v} stays a map.
Call
Inspect(String)
Variable inspection (INSPECT($var)): carries the variable name
unevaluated so evaluation can snapshot the binding. Produced only by
the parser for the exact INSPECT name; evaluators match on this
variant and never on a function-name string.
Compare
Arithmetic
CompiledMath(Vec<MathOp>)
Lowering-optimized form: folded literals stay Literal, dynamic
arithmetic/comparison subtrees arrive here as flat RPN.
FreshPipe
Fresh anonymous pipe backend (LET $p: PIPE with no initializer).
Evaluates to a pipe value keyed by a generated name that no
pipe: literal can spell, so bare declarations never collide
with named pipes. Transitional representation until backends
become owned handles.
UnsignedIntBoundary(u64)
Lowering-only intermediate staging 9223372036854775808 (the unsigned
half of i64::MIN). Valid only as the direct child of unary -;
any instance reaching lowering completion bails integer overflow.