diff options
author | Daniel <kingdread@gmx.de> | 2020-05-04 15:25:33 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-05-04 15:25:33 +0200 |
commit | 74dc6574650a157ab57779dc633e140d020b792a (patch) | |
tree | 6543a81e0545b9acfeea64a63547c0f7aadf996c /src/fexpr/grammar.lalrpop | |
parent | 6afe5879579ad39397024fbdbe75ad3207ff50a1 (diff) | |
download | raidgrep-74dc6574650a157ab57779dc633e140d020b792a.tar.gz raidgrep-74dc6574650a157ab57779dc633e140d020b792a.tar.bz2 raidgrep-74dc6574650a157ab57779dc633e140d020b792a.zip |
add -class player filter
Diffstat (limited to 'src/fexpr/grammar.lalrpop')
-rw-r--r-- | src/fexpr/grammar.lalrpop | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop index 654722b..f91da19 100644 --- a/src/fexpr/grammar.lalrpop +++ b/src/fexpr/grammar.lalrpop @@ -3,6 +3,7 @@ use super::{ FErrorKind, FightOutcome, filters, + PlayerClass, SearchField, }; use evtclib::Boss; @@ -77,6 +78,8 @@ PlayerPredicate: Box<dyn filters::player::PlayerFilter> = { filters::player::account(<>.clone()) | filters::player::character(<>), + "-class" <Comma<PlayerClass>> => filters::player::class(<>), + "(" <PlayerFilter> ")", } @@ -135,6 +138,16 @@ Boss: Boss = { }), } +PlayerClass: PlayerClass = { + <l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User { + error: FError { + location: l, + data: w.into(), + kind: FErrorKind::InvalidClass, + } + }), +} + Date: DateTime<Utc> = { <l:@L> <d:datetime> =>? Local.datetime_from_str(d, "%Y-%m-%d %H:%M:%S") .map_err(|error| ParseError::User { |