diff options
author | Daniel <kingdread@gmx.de> | 2020-06-12 13:21:35 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-06-12 13:21:35 +0200 |
commit | e23af286b81f4c9df0e0ca9d71113caeb909cb0f (patch) | |
tree | 67577bba72ce42dcb6b9920192d31292e476239a /src/fexpr/grammar.lalrpop | |
parent | 600683df83cea34f10341d7fe2a328559c578379 (diff) | |
download | raidgrep-e23af286b81f4c9df0e0ca9d71113caeb909cb0f.tar.gz raidgrep-e23af286b81f4c9df0e0ca9d71113caeb909cb0f.tar.bz2 raidgrep-e23af286b81f4c9df0e0ca9d71113caeb909cb0f.zip |
implement count(player: ...) construct
Diffstat (limited to 'src/fexpr/grammar.lalrpop')
-rw-r--r-- | src/fexpr/grammar.lalrpop | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop index 9584536..9eef21a 100644 --- a/src/fexpr/grammar.lalrpop +++ b/src/fexpr/grammar.lalrpop @@ -7,6 +7,7 @@ use super::{ DateProducer, DurationProducer, + CountProducer, }; use evtclib::Boss; use std::collections::HashSet; @@ -73,6 +74,7 @@ LogPredicate: Box<dyn filters::log::LogFilter> = { <Comparison<DateProducer>>, <Comparison<DurationProducer>>, + <Comparison<CountProducer>>, "(" <LogFilter> ")", } @@ -215,6 +217,11 @@ DurationProducer: Box<dyn DurationProducer> = { "-duration" => filters::values::duration(), } +CountProducer: Box<dyn CountProducer> = { + <integer> => filters::values::constant(<>.parse().unwrap()), + "count" "(" "player" ":" <PlayerFilter> ")" => filters::values::player_count(<>), +} + match { "player" => "player", "not" => "not", @@ -223,10 +230,12 @@ match { "any" => "any", "all" => "all", "exists" => "exists", + "count" => "count", r"\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d" => datetime, r"\d\d\d\d-\d\d-\d\d" => date, r"((\d+m ?)?\d+s)|(\d+m)" => duration, + r"\d+" => integer, r"[[:alpha:]][\w]*" => word, r#""[^"]*""# => string, |