Skip to main content

Module expr

Module expr 

Source
Expand description

The Transform expression language: the tokenizer, the parser and the evaluator (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md Β§3.9).

StructsΒ§

Eval πŸ”’
Parser πŸ”’
State πŸ”’
What one node’s evaluation carries between elements: the budget it has spent.

EnumsΒ§

Expr πŸ”’
Op πŸ”’
Token πŸ”’

ConstantsΒ§

MAX_EVAL_DEPTH πŸ”’
How deep an expression tree may be before evaluation stops: a chain such as 1 + 1 + ... is not nested in the source but is deep in the tree.
MAX_EXPRESSION_BYTES πŸ”’
An expression’s source may be at most this long. The grammar is small, and a bound keeps the tokenizer and parser work finite; the size of a matches pattern is bounded separately, where the pattern is compiled.
MAX_NESTING_DEPTH πŸ”’
How deeply a source may nest (, [, ! and -. The parser is recursive, so a source nested further is an expression error rather than a stack overflow.
MAX_OPERATORS πŸ”’
How many binary operators one expression may hold. A chain is built by a loop, so it is neither nested in the source nor limited by the nesting depth, but dropping its tree recurses once per node.

FunctionsΒ§

arithmetic πŸ”’
as_list πŸ”’
binary πŸ”’
charge πŸ”’
One unit of the evaluation budget; the total may not pass MAX_OPERATIONS.
cmp_same_class πŸ”’
compare πŸ”’
contains πŸ”’
equal πŸ”’
eval_at πŸ”’
function_arity πŸ”’
How many arguments each function name takes; anything else is unknown.
in_set πŸ”’
lookup_path πŸ”’
negate πŸ”’
number_at πŸ”’
operator_at πŸ”’
parse_object_path πŸ”’
A dotted path with no operators, for exists over an object.
parse_opt πŸ”’
parse_or πŸ”’
text_at πŸ”’
tokenize πŸ”’
value_class πŸ”’
The type a sort key must share with every other key before ordering is defined; ordering across types is an expression error.