Skip to main content

parse_formula

Function parse_formula 

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

Parse a formula from a string.

§Examples

use lolli_parse::parse_formula;

// Simple atom
let f = parse_formula("A").unwrap();

// Linear implication
let f = parse_formula("A -o B").unwrap();

// Complex formula
let f = parse_formula("!A * B -o C + D").unwrap();

§Errors

Returns a ParseError if the input is not a valid formula.