[Parser]
Remove predicate_ops function and use the identical method `is_comparator` which was added on the binary type method
@@ -2,19 +2,6 @@ use super::*;
pub struct BinaryParser;
-// XXX(low) : Check that these are the only possible predicate ops
-// predicate operators are capable of returning a 0 or 1
-const fn predicate_ops() -> [BinaryOp; 6] {
- [
- BinaryOp::Equal,
- BinaryOp::NotEqual,
- BinaryOp::LessEqual,
- BinaryOp::Less,
- BinaryOp::Greater,
- BinaryOp::GreaterEqual,
- ]
-}
-
impl InfixParser for BinaryParser {
fn parse(parser: &mut Parser, lhs: Expression) -> Expression {
let operator: BinaryOp = parser.curr_token.clone().into();
@@ -29,7 +16,7 @@ impl InfixParser for BinaryParser {
rhs: rhs.clone(),
});
- if predicate_ops().contains(&operator) {
+ if operator.is_comparator() {
return Expression::Predicate(infix_expression);
}
