pub enum Expr {
Lit(ExprLit),
Ref(String),
Unary(UnOp, Box<Expr>),
Binary(BinOp, Box<Expr>, Box<Expr>),
Call(Builtin, Vec<Expr>),
Field(Box<Expr>, String),
Index(Box<Expr>, Box<Expr>),
}Expand description
A pure, total expression in AXON’s closed-catalog expression sublanguage
(§Fase 70). Evaluates to a value with no side effects, no I/O, no recursion
and no unbounded loops — so it is decidable and const-foldable. Mounted as
the condition of an if (and, in later sub-fases, let values + where:
predicates). Field/index access and the builtin catalog land in §70.c/d.
Variants§
Lit(ExprLit)
A typed literal (42, 3.14, true, "hello").
Ref(String)
A reference to a binding or dotted path (x, User.tier).
Unary(UnOp, Box<Expr>)
A unary operation (-x, not x).
Binary(BinOp, Box<Expr>, Box<Expr>)
A binary operation (a + b, a >= b, a and b).
Call(Builtin, Vec<Expr>)
§Fase 70.c — a closed-catalog builtin call. args[0] is the receiver
(the value before the .); any further entries are the call arguments.
E.g. recent.length → Call(Length, [Ref("recent")]),
name.starts_with("Dr") → Call(StartsWith, [Ref("name"), Lit(Str)]).
Field(Box<Expr>, String)
§Fase 70.d — field access on a non-reference base (items[0].name,
(expr).field). A plain dotted path stays a Ref (a.b.c) for
back-compat; this node is the structured form the JSONB SQL lowering
(deferred §73) consumes. The String is the field name.
Index(Box<Expr>, Box<Expr>)
§Fase 70.d — index access base[index] (array element / string char).