2022-06-18 21:56:31 -07:00
|
|
|
use super::*;
|
2021-09-16 16:45:56 -07:00
|
|
|
|
|
|
|
/// A conditional expression operator.
|
|
|
|
#[derive(PartialEq, Debug, Copy, Clone)]
|
|
|
|
pub(crate) enum ConditionalOperator {
|
|
|
|
/// `==`
|
|
|
|
Equality,
|
|
|
|
/// `!=`
|
|
|
|
Inequality,
|
|
|
|
/// `=~`
|
|
|
|
RegexMatch,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Display for ConditionalOperator {
|
|
|
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
|
|
|
match self {
|
|
|
|
Self::Equality => write!(f, "=="),
|
|
|
|
Self::Inequality => write!(f, "!="),
|
|
|
|
Self::RegexMatch => write!(f, "=~"),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|