pub fn parse_expr(input: &str) -> Result<Expr, ExprError>Expand description
Parse a string expression into an Expr AST.
Syntax: expr → or_expr or_expr → and_expr ( “or” and_expr )* and_expr → not_expr ( “and” not_expr )* not_expr → “not” not_expr | comparison comparison → add_expr ( (“==” | “!=” | “>” | “>=” | “<” | “<=”) add_expr | (“in” | “not” “in”) list_literal )? add_expr → mul_expr ( (“+” | “-”) mul_expr )* mul_expr → unary_expr ( (“” | “/” | “//” | “%”) unary_expr ) unary_expr → (“+” | “-”) unary_expr | pow_expr pow_expr → atom ( “**” unary_expr )? atom → primary ( “.” METHOD_CALL )* primary → NUMBER | STRING | BOOL | IDENT | LOCAL | “abs” “(” expr “)” | “(” expr “)”
Nesting is bounded: more than MAX_BRACKET_NESTING open brackets, or
a tree deeper than MAX_EXPR_DEPTH, is a ExprError::ParseError
rather than a stack overflow (br-frankenpandas-bhbuz).