feat!: support the case-insensitive regex flag

This commit is contained in:
Amaan Qureshi 2023-08-06 20:30:02 -04:00
parent fc88622b7b
commit f35752e3ac
No known key found for this signature in database
GPG key ID: E67890ADC4227273
7 changed files with 166 additions and 85 deletions

View file

@ -56,7 +56,7 @@ pub(crate) struct Symbol {
pub(crate) enum Rule {
Blank,
String(String),
Pattern(String),
Pattern(String, String),
NamedSymbol(String),
Symbol(Symbol),
Choice(Vec<Rule>),
@ -187,8 +187,8 @@ impl Rule {
Rule::String(value.to_string())
}
pub fn pattern(value: &'static str) -> Self {
Rule::Pattern(value.to_string())
pub fn pattern(value: &'static str, flags: &'static str) -> Self {
Rule::Pattern(value.to_string(), flags.to_string())
}
}