aboutsummaryrefslogtreecommitdiff
path: root/src/fexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/fexpr')
-rw-r--r--src/fexpr/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fexpr/mod.rs b/src/fexpr/mod.rs
index f2b1090..aafdea7 100644
--- a/src/fexpr/mod.rs
+++ b/src/fexpr/mod.rs
@@ -4,7 +4,7 @@
//! type and convert it to a [`Filter`][super::filters::Filter].
// Make it available in the grammar mod.
use super::{filters, FightOutcome, SearchField, Weekday};
-use lalrpop_util::lalrpop_mod;
+use lalrpop_util::{lalrpop_mod, lexer::Token, ParseError};
use thiserror::Error;
@@ -23,3 +23,9 @@ pub enum FError {
#[error("invalid boss name: {0}")]
InvalidBoss(String),
}
+
+pub fn parse_logfilter(
+ input: &str,
+) -> Result<Box<dyn filters::log::LogFilter>, ParseError<usize, Token, FError>> {
+ grammar::LogFilterParser::new().parse(input)
+}