diff options
Diffstat (limited to 'src/fexpr/grammar.lalrpop')
| -rw-r--r-- | src/fexpr/grammar.lalrpop | 36 | 
1 files changed, 21 insertions, 15 deletions
| diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop index 1540aae..6a7a9a0 100644 --- a/src/fexpr/grammar.lalrpop +++ b/src/fexpr/grammar.lalrpop @@ -11,7 +11,7 @@ use std::collections::HashSet;  use lalrpop_util::ParseError;  use chrono::{DateTime, Local, TimeZone, Utc, Weekday}; -use regex::Regex; +use regex::{Regex, RegexBuilder};  grammar; @@ -85,20 +85,26 @@ PlayerPredicate: Box<dyn filters::player::PlayerFilter> = {  }  Regex: Regex = { -    <l:@L> <s:string> =>? Regex::new(&s[1..s.len() - 1]).map_err(|error| ParseError::User { -        error: FError { -            location: l, -            data: s.to_string(), -            kind: error.into(), -        } -    }), -    <l:@L> <s:word> =>? Regex::new(s).map_err(|error| ParseError::User { -        error: FError { -            location: l, -            data: s.to_string(), -            kind: error.into(), -        } -    }), +    <l:@L> <s:string> =>? RegexBuilder::new(&s[1..s.len() - 1]) +        .case_insensitive(true) +        .build() +        .map_err(|error| ParseError::User { +            error: FError { +                location: l, +                data: s.to_string(), +                kind: error.into(), +            } +        }), +    <l:@L> <s:word> =>? RegexBuilder::new(s) +        .case_insensitive(true) +        .build() +        .map_err(|error| ParseError::User { +            error: FError { +                location: l, +                data: s.to_string(), +                kind: error.into(), +            } +        }),  }  FightOutcome: FightOutcome = { | 
