parse

Function parse 

Source
pub fn parse(input: &str) -> Result<Expr, ParseError>
Expand description

Parse a mathematical expression string into an AST.

§Arguments

  • input - The expression string to parse

§Returns

  • Ok(Expr) - The parsed AST
  • Err(ParseError) - If parsing fails

§Example

use mathexpr::parse;

let ast = parse("sqrt(x^2 + y^2)").unwrap();