Skip to main content

parse_with_table

Function parse_with_table 

Source
pub fn parse_with_table(
    input: &str,
    builder: &mut DagBuilder,
    table: &PrecedenceTable,
) -> Result<DagNodeId, ParseError>
Expand description

Parses input using a caller-supplied PrecedenceTable.

This is the runtime-extensible counterpart to parse_expression. Where parse_expression always uses the six built-in operators (+, -, *, /, %, ^), this function consults table for every infix token it encounters. Custom operators registered via PrecedenceTable::register are fully supported.

§Errors

Returns a ParseError on syntax errors, unexpected trailing tokens, or paren-depth overflow — identical semantics to parse_expression.