1 stable release

1.0.0 Apr 24, 2022

#4 in #extensible

21 downloads per month

MIT license

12KB
353 lines

githubcrates-iodocs-rs
Build Status

ELES; Extensible Logical Expression Solver

If you have an existing parser that outputs a single boolean value and you want to add support for AND, OR, XOR, and parentheses, ELES can be of great help. For example, if you already have a system that interprets string syntax to determine/search data for a single item, and you want to support AND/OR searches for multiple items or complex conditions assembled using parentheses, ELES is the usefull library for you.

Example

// The simplest example
fn main()
{
 let input = "true && (( false ^^ true && !! false )) || false";
 let literal_parser = |literal: &str| Ok(literal.parse::<bool>().unwrap_or_default());
 let r = eles::solve(&input, literal_parser);
 println!("{:?}", r);
}

More examples are here:

And these tests might be usefull that study usage:

LICENSE

Author

Dependencies

~125KB