pub enum IrExpr {
Literal(IrLiteral),
VarRef(VarId),
PropertyAccess {
base: ExprId,
prop: PropId,
},
BinaryOp {
op: BinaryOpKind,
left: ExprId,
right: ExprId,
},
UnaryOp {
op: UnaryOpKind,
expr: ExprId,
},
FunctionCall {
name: String,
args: Vec<ExprId>,
},
Parameter(String),
Case {
operand: Option<ExprId>,
arms: Vec<CaseArm>,
else_expr: Option<ExprId>,
},
ListLiteral(Vec<ExprId>),
MapLiteral(Vec<(String, ExprId)>),
Quantifier {
kind: QuantifierKind,
loop_var: VarId,
list: ExprId,
predicate: ExprId,
},
ListComprehension {
loop_var: VarId,
list: ExprId,
filter: Option<ExprId>,
projection: Option<ExprId>,
},
}Expand description
A single node in the ExprArena.
Every ExprId child is an index into the same arena; the arena owns all
nodes and is the authoritative source of truth for expression structure.
Variants§
Literal(IrLiteral)
A scalar constant.
VarRef(VarId)
A reference to a pattern variable (e.g. n in MATCH (n:Person)).
PropertyAccess
A property read: base.prop.
Fields
BinaryOp
A binary infix expression.
Fields
op: BinaryOpKindThe operator.
UnaryOp
A unary prefix expression.
FunctionCall
A built-in or user-defined function call.
Fields
Parameter(String)
A named query parameter (e.g. $name).
Case
A CASE expression.
Fields
ListLiteral(Vec<ExprId>)
A list literal: [e0, e1, …].
MapLiteral(Vec<(String, ExprId)>)
A map literal: {k0: e0, k1: e1, …}.
Keys are plain strings; values are ExprId references.
Quantifier
A quantifier predicate all/any/none/single(loop_var IN list WHERE pred).
loop_var is bound (only) within predicate. (#955)
Fields
kind: QuantifierKindWhich quantifier (all/any/none/single).
ListComprehension
A list comprehension [loop_var IN list WHERE filter | projection].
loop_var is bound (only) within filter and projection. Either of
filter/projection may be absent (a bare [x IN list] is the list
itself; [x IN list WHERE p] filters; [x IN list | e] maps). (#955)