diff options
-rw-r--r-- | src/fexpr/grammar.lalrpop | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop index a406490..f193a90 100644 --- a/src/fexpr/grammar.lalrpop +++ b/src/fexpr/grammar.lalrpop @@ -80,7 +80,7 @@ PlayerPredicate: Box<dyn filters::player::PlayerFilter> = { } Regex: Regex = { - <l:@L> <s:regex> =>? Regex::new(&s[1..s.len() - 1]).map_err(|error| ParseError::User { + <l:@L> <s:string> =>? Regex::new(&s[1..s.len() - 1]).map_err(|error| ParseError::User { error: FError { location: l, data: s.to_string(), @@ -124,6 +124,14 @@ Boss: Boss = { kind: FErrorKind::InvalidBoss, } }), + + <l:@L> <s:string> =>? s[1..s.len() -1].parse().map_err(|_| ParseError::User { + error: FError { + location: l, + data: s.into(), + kind: FErrorKind::InvalidBoss, + } + }), } Date: NaiveDateTime = { @@ -165,7 +173,7 @@ match { 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"\w+" => word, - r#""[^"]*""# => regex, + r#""[^"]*""# => string, _ } |