Skip to main content

Module expr

Module expr 

Source
Expand description

Precedence-climbing expression parser.

Per parser_review §2 / §3:

  • Recursion is depth-capped at MAX_PAREN_DEPTH so (((...))) inputs cannot blow the OS stack.
  • Errors carry a Span with line/column information, computed against the original source buffer (not the remaining suffix).

Structs§

PrecedenceTable
A runtime-extensible operator precedence table for the expression parser.

Constants§

MAX_PAREN_DEPTH
Maximum allowed depth of parenthesis / operator recursion.

Functions§

parse_expression
Parses a mathematical string expression into the global DAG.
parse_with_table
Parses input using a caller-supplied PrecedenceTable.