Skip to main content

parse_equation_system

Function parse_equation_system 

Source
pub fn parse_equation_system(input: &str) -> ParseResult<Vec<Expression>>
Expand description

Parses a semicolon-delimited string of equations into a vector of expressions.

Each segment separated by ; is parsed as an independent expression. Empty segments (e.g., from trailing semicolons) are ignored.

§Errors

Returns a ParseError from the first segment that fails to parse.

§Examples

use mathlex::parser::text::parse_equation_system;
use mathlex::Expression;

let exprs = parse_equation_system("x + y = 5; 2*x - y = 1").unwrap();
assert_eq!(exprs.len(), 2);