Expand description
A Pratt (precedence-climbing) parser turning a token stream into an Expr.
Tolerant: on a syntax error it returns Err(BaseError::Expr); callers render
that as an inline error rather than failing the build.
Constants§
- MAX_
PARSE_ DEPTH - Maximum expression nesting depth. Guards against a stack overflow from
adversarial input (e.g. a
.basefilter of thousands of nested(/!/-): past this depthparsereturns an error rather than recursing to a crash. The evaluator enforces a matching cap (seeeval::MAX_EVAL_DEPTH). - MAX_
PARSE_ NODES - Maximum total AST nodes in one expression. Bounds a long postfix chain
(
a.a.a…/f()()()…), which is built iteratively and so escapes the depth guard — an unbounded chain would overflow both the evaluator and the recursiveBox<Expr>drop. Real base expressions are tiny; this is a generous ceiling.
Functions§
- parse
- Parse a whole expression string. Trailing tokens after a complete expression are an error.