MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / evaluate_comparison

Function evaluate_comparison

crates/gitql-engine/src/engine_evaluator.rs:353–370  ·  view source on GitHub ↗
(
    env: &mut Environment,
    expr: &ComparisonExpr,
    titles: &[String],
    object: &Vec<Box<dyn Value>>,
)

Source from the content-addressed store, hash-verified

351}
352
353fn evaluate_comparison(
354 env: &mut Environment,
355 expr: &ComparisonExpr,
356 titles: &[String],
357 object: &Vec<Box<dyn Value>>,
358) -> Result<Box<dyn Value>, String> {
359 let lhs = evaluate_expression(env, &expr.left, titles, object)?;
360 let rhs = evaluate_expression(env, &expr.right, titles, object)?;
361 match expr.operator {
362 ComparisonOperator::Greater => lhs.gt_op(&rhs),
363 ComparisonOperator::GreaterEqual => lhs.gte_op(&rhs),
364 ComparisonOperator::Less => lhs.lt_op(&rhs),
365 ComparisonOperator::LessEqual => lhs.lte_op(&rhs),
366 ComparisonOperator::Equal => lhs.eq_op(&rhs),
367 ComparisonOperator::NotEqual => lhs.bang_eq_op(&rhs),
368 ComparisonOperator::NullSafeEqual => lhs.null_safe_eq_op(&rhs),
369 }
370}
371
372fn evaluate_group_comparison(
373 env: &mut Environment,

Callers 1

evaluate_expressionFunction · 0.85

Calls 8

evaluate_expressionFunction · 0.85
null_safe_eq_opMethod · 0.80
gt_opMethod · 0.45
gte_opMethod · 0.45
lt_opMethod · 0.45
lte_opMethod · 0.45
eq_opMethod · 0.45
bang_eq_opMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…