diff options
author | Daniel <kingdread@gmx.de> | 2020-04-18 15:12:21 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-04-18 15:12:21 +0200 |
commit | e19519e155af95698807f377a5f6b525e255c4e5 (patch) | |
tree | fdd80ce3675f6b0dea70239d6c4a14affff96a13 /src/fexpr/mod.rs | |
parent | 7030224fd2a97b3551fdd47c43249e3a42341238 (diff) | |
download | raidgrep-e19519e155af95698807f377a5f6b525e255c4e5.tar.gz raidgrep-e19519e155af95698807f377a5f6b525e255c4e5.tar.bz2 raidgrep-e19519e155af95698807f377a5f6b525e255c4e5.zip |
first version of the new filter pipeline
Diffstat (limited to 'src/fexpr/mod.rs')
-rw-r--r-- | src/fexpr/mod.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fexpr/mod.rs b/src/fexpr/mod.rs new file mode 100644 index 0000000..f2b1090 --- /dev/null +++ b/src/fexpr/mod.rs @@ -0,0 +1,25 @@ +//! Filter expression language. +//! +//! This module contains methods to parse a given string into an abstract filter tree, check its +//! 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 thiserror::Error; + +lalrpop_mod!(pub grammar, "/fexpr/grammar.rs"); + +#[derive(Debug, Error)] +pub enum FError { + #[error("invalid regular expression: {0}")] + InvalidRegex(String), + #[error("invalid fight outcome: {0}")] + InvalidFightOutcome(String), + #[error("invalid weekday: {0}")] + InvalidWeekday(String), + #[error("invalid timestamp: {0}")] + InvalidTimestamp(String), + #[error("invalid boss name: {0}")] + InvalidBoss(String), +} |