ooroo 0.1.0

A fast, compiled rule engine with a text-based DSL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod error;
mod grammar;
mod parser;

pub use error::ParseError;
pub use parser::ParsedRuleSet;

/// Parse a DSL input string into a [`ParsedRuleSet`].
///
/// # Errors
///
/// Returns [`ParseError`] if the input is not valid DSL syntax.
pub fn parse(input: &str) -> Result<ParsedRuleSet, ParseError> {
    use winnow::Parser;
    grammar::parse_ruleset
        .parse(input)
        .map_err(|e| ParseError::new(e.to_string()))
}