pub(crate) mod cache;
pub mod compiled_rules;
pub(crate) mod compiler;
pub(crate) mod condition;
pub(crate) mod config;
pub mod engine;
pub mod error;
pub mod models;
pub(crate) mod parser;
pub use compiled_rules::CompiledRules;
pub use error::SyaraError;
pub use models::{Match, MatchDetail, Rule};
use std::path::Path;
pub fn compile(path: impl AsRef<Path>) -> Result<CompiledRules, SyaraError> {
let rules = parser::SyaraParser::new().parse_file(path)?;
let registry = config::Registry::new();
compiler::Compiler::compile(rules, registry)
}
pub fn compile_str(src: &str) -> Result<CompiledRules, SyaraError> {
let rules = parser::SyaraParser::new().parse_str(src)?;
let registry = config::Registry::new();
compiler::Compiler::compile(rules, registry)
}