pub enum ExpressionKind {
Show 22 variants
Literal(Value),
ImplicitRowValue,
Reference(Reference),
Now,
DateRelative(DateRelativeKind, ExprId),
DateCalendar(DateCalendarKind, CalendarPeriodUnit, ExprId),
RangeLiteral(ExprId, ExprId),
PastFutureRange(DateRelativeKind, ExprId),
RangeContainment(ExprId, ExprId),
RangeBound(RangeBound, ExprId),
Logical {
connective: LogicalConnective,
first: ExprId,
steps: Vec<ChainStep<()>>,
},
Arithmetic {
first: ExprId,
steps: Vec<ChainStep<ArithmeticComputation>>,
},
Comparison(ExprId, ComparisonComputation, ExprId),
UnitConversion(ExprId, ConversionTarget),
LogicalNegation(ExprId, NegationType),
MathematicalComputation(MathematicalComputation, ExprId),
Veto(VetoExpression),
ResultIsVeto(ExprId),
ListType {
element: ParentType,
},
ListCommand {
list: ExprId,
command: ListCommand,
},
StepRounding {
operand: ExprId,
mode: RoundingMode,
step: Option<ExprId>,
},
Member {
base: ExprId,
path: Reference,
},
}Expand description
The kind/type of expression
Variants§
Literal(Value)
Parse-time literal value (type will be resolved during planning)
ImplicitRowValue
Parser-only current value-list row inside a headless predicate comparison.
Reference(Reference)
Unresolved reference (identifier or dot path). Resolved during planning to DataPath or RulePath.
Now
The now keyword — resolves to the evaluation datetime (= effective).
DateRelative(DateRelativeKind, ExprId)
Date-relative sugar: <date_expr> in past / <date_expr> in future
Fields: (kind, date_expression)
DateCalendar(DateCalendarKind, CalendarPeriodUnit, ExprId)
Calendar-period sugar: <date_expr> in [past|future] calendar year|month|week
Fields: (kind, unit, date_expression)
RangeLiteral(ExprId, ExprId)
Range literal: {left_expr}...{right_expr}
PastFutureRange(DateRelativeKind, ExprId)
Relative date range: past 7 day / future 30 day
RangeContainment(ExprId, ExprId)
Range containment: {value_expr} in {range_expr}
RangeBound(RangeBound, ExprId)
Ordered endpoint of a range: lower (included) or upper (excluded).
Logical
One left fold of one logical connective, operands in source order.
Arithmetic
a + b - c * d: one left fold per precedence level, operands in source order.
Comparison(ExprId, ComparisonComputation, ExprId)
UnitConversion(ExprId, ConversionTarget)
LogicalNegation(ExprId, NegationType)
MathematicalComputation(MathematicalComputation, ExprId)
Veto(VetoExpression)
ResultIsVeto(ExprId)
expr is veto / veto is expr — boolean: whether evaluating expr yields OperationResult::Veto.
ListType
Type in expression position: text list, money list, money range list.
Fields
element: ParentTypeListCommand
Postfix -> list command: fares -> sum, fares -> where >= 100 eur.
StepRounding
Postfix -> rounding: x -> round, or price -> round 0.05 eur with a step.
Member
Postfix member read on a parenthesised expression: (staff -> find "ada").salary.