aboutsummaryrefslogtreecommitdiff
path: root/src/fexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/fexpr')
-rw-r--r--src/fexpr/grammar.lalrpop17
-rw-r--r--src/fexpr/mod.rs2
2 files changed, 18 insertions, 1 deletions
diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop
index ce78396..bca7691 100644
--- a/src/fexpr/grammar.lalrpop
+++ b/src/fexpr/grammar.lalrpop
@@ -9,7 +9,7 @@ use super::{
DurationProducer,
CountProducer,
};
-use evtclib::Encounter;
+use evtclib::{Encounter, GameMode};
use std::collections::HashSet;
use lalrpop_util::ParseError;
@@ -64,6 +64,12 @@ LogPredicate: Box<dyn filters::log::LogFilter> = {
"-boss" <Comma<Encounter>> => filters::log::encounter(<>),
"-cm" => filters::log::challenge_mote(),
+ "-raid" => filters::log::game_mode([GameMode::Raid].into()),
+ "-fractal" => filters::log::game_mode([GameMode::Fractal].into()),
+ "-strike" => filters::log::game_mode([GameMode::Strike].into()),
+ "-wvw" => filters::log::game_mode([GameMode::WvW].into()),
+ "-gamemode" <Comma<GameMode>> => filters::log::game_mode(<>),
+
"-include" => filters::constant(true),
"-exclude" => filters::constant(false),
@@ -150,6 +156,15 @@ Encounter: Encounter = {
}),
}
+GameMode: GameMode = {
+ <l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User {
+ error: FError {
+ location: l,
+ kind: FErrorKind::GameMode,
+ }
+ }),
+}
+
PlayerClass: PlayerClass = {
<l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User {
error: FError {
diff --git a/src/fexpr/mod.rs b/src/fexpr/mod.rs
index 0fe2acf..6eeb753 100644
--- a/src/fexpr/mod.rs
+++ b/src/fexpr/mod.rs
@@ -51,6 +51,8 @@ pub enum FErrorKind {
Boss,
#[error("invalid class name")]
Class,
+ #[error("invalid game mode")]
+ GameMode,
}
/// Shortcut to create a new parser and parse the given input.