Add affinity check as a function as ast::Operator impl

This commit is contained in:
Krishna Vishal
2025-06-08 22:00:48 +05:30
parent 712c94537c
commit 0d5cbc4f1d
2 changed files with 17 additions and 11 deletions

View File

@@ -731,6 +731,21 @@ impl Operator {
| Operator::NotEquals
)
}
/// Returns true if this operator is a comparison operator that may need affinity conversion
pub fn is_comparison(&self) -> bool {
matches!(
self,
Self::Equals
| Self::NotEquals
| Self::Less
| Self::LessEquals
| Self::Greater
| Self::GreaterEquals
| Self::Is
| Self::IsNot
)
}
}
/// Unary operators