Expand description
VAPP-191 (eApps Q2): expressions, the Rust twin of
packages/exponential-ui/src/cel.ts (line by line; read its header for
the language). A SUBSET of CEL with ONE number type (a double, like
JSON), hand-written so both twins replay fixtures/expressions.json
exactly: numbers, dates and error texts. No loops, no user functions, a
length cap, no nested comprehensions and a step limit, so it always
terminates. The functions are ONE table shared with the A2UI function
form ({"call": "mul", …}, call_expression_function); dates run in
the team zone (an offset per instant, ExpressionEnv::offset).
Structs§
- Expression
Env - The clock, the team zone and the step limit an evaluation runs with.
Enums§
- Node
- A parsed expression (
at= the code point it starts at).
Constants§
- CALENDAR_
UNITS - CALL_
NAMES - The A2UI form’s names in the bind table (
size= the existinglen;expr= the string form,{expr, vars}). - DATE_
UNITS - Every unit
dateAdd/dateDifftake;startOf/endOftake the calendar ones. - DURATION_
FORMATS - The formats
formatDurationwrites. - FUNCTION_
NAMES - THE function table (spec §4.2), positional for CEL, named (
args) for the A2UI form. Generic only: no working days, no holidays. - MAX_
DEPTH - MAX_
LENGTH - The cost caps (spec §4.2): characters (code points), nesting, steps.
- MAX_
STEPS
Functions§
- call_
expression_ function - The A2UI function form
{call: name, args}with its arguments resolved. OuterNone= not an expression function; innerNone= no value (an error, like every bind-time function). - check_
expression - Type-check an expression against the names it may read (a kind’s
fields, a binding’s value): the type, or the error (the parse error, or
the first type error). Types are spelled as JSON (
"number",[T], a row object). - evaluate_
expression - Evaluate an expression over
vars: the value, or the error (a syntax, type, range or cost error). - evaluate_
node - Evaluate a parsed tree (see
parse_expression). - format_
timestamp - An instant as
YYYY-MM-DDTHH:MM:SS.sssZ(JStoISOString), years 0..9999. - parse_
expression - Parse once (at package validation, or before evaluating): the tree, or
the first syntax / cost error (
at <code point>: <reason>). - parse_
timestamp - An ISO instant (
YYYY-MM-DDTHH:MM[:SS[.fff]][Z|±HH:MM], no offset = UTC) as epoch ms;Nonewhen it is not one. - type_
display - The name a type prints as in an error: a list
list, a rowmap. - type_
name - The runtime type name errors print.