Skip to content

Commit

Permalink
Rename to RegexMismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Dec 10, 2024
1 parent bc6e1ff commit f0752d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/conditional_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub(crate) enum ConditionalOperator {
/// `=~`
RegexMatch,
/// `!~`
RegexNotMatch,
RegexMismatch,
}

impl Display for ConditionalOperator {
Expand All @@ -19,7 +19,7 @@ impl Display for ConditionalOperator {
Self::Equality => write!(f, "=="),
Self::Inequality => write!(f, "!="),
Self::RegexMatch => write!(f, "=~"),
Self::RegexNotMatch => write!(f, "!~"),
Self::RegexMismatch => write!(f, "!~"),
}
}
}
2 changes: 1 addition & 1 deletion src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl<'src, 'run> Evaluator<'src, 'run> {
ConditionalOperator::RegexMatch => Regex::new(&rhs_value)
.map_err(|source| Error::RegexCompile { source })?
.is_match(&lhs_value),
ConditionalOperator::RegexNotMatch => !Regex::new(&rhs_value)
ConditionalOperator::RegexMismatch => !Regex::new(&rhs_value)
.map_err(|source| Error::RegexCompile { source })?
.is_match(&lhs_value),
};
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ impl<'run, 'src> Parser<'run, 'src> {
} else if self.accepted(EqualsTilde)? {
ConditionalOperator::RegexMatch
} else if self.accepted(BangTilde)? {
ConditionalOperator::RegexNotMatch
ConditionalOperator::RegexMismatch
} else {
self.expect(EqualsEquals)?;
ConditionalOperator::Equality
Expand Down
4 changes: 2 additions & 2 deletions src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub enum ConditionalOperator {
Equality,
Inequality,
RegexMatch,
RegexNotMatch,
RegexMismatch,
}

impl ConditionalOperator {
Expand All @@ -369,7 +369,7 @@ impl ConditionalOperator {
full::ConditionalOperator::Equality => Self::Equality,
full::ConditionalOperator::Inequality => Self::Inequality,
full::ConditionalOperator::RegexMatch => Self::RegexMatch,
full::ConditionalOperator::RegexNotMatch => Self::RegexNotMatch,
full::ConditionalOperator::RegexMismatch => Self::RegexMismatch,
}
}
}
Expand Down

0 comments on commit f0752d6

Please sign in to comment.