MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / HandleHeterogeneousEquality

Method HandleHeterogeneousEquality

eval/compiler/flat_expr_builder.cc:2095–2118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2093}
2094
2095FlatExprVisitor::CallHandlerResult FlatExprVisitor::HandleHeterogeneousEquality(
2096 const cel::Expr& expr, const cel::CallExpr& call, bool inequality) {
2097 if (!ValidateOrError(
2098 call.args().size() == 2 && !call.has_target(),
2099 "unexpected number of args for builtin equality operator")) {
2100 return CallHandlerResult::kIntercepted;
2101 }
2102
2103 if (auto depth = RecursionEligible(); depth.has_value()) {
2104 auto args = ExtractRecursiveDependencies();
2105 if (args.size() != 2) {
2106 SetProgressStatusError(absl::InvalidArgumentError(
2107 "unexpected number of args for builtin equality operator"));
2108 return CallHandlerResult::kIntercepted;
2109 }
2110 SetRecursiveStep(
2111 CreateDirectEqualityStep(std::move(args[0]), std::move(args[1]),
2112 inequality, expr.id()),
2113 *depth + 1);
2114 return CallHandlerResult::kIntercepted;
2115 }
2116 AddStep(CreateEqualityStep(inequality, expr.id()));
2117 return CallHandlerResult::kIntercepted;
2118}
2119
2120FlatExprVisitor::CallHandlerResult
2121FlatExprVisitor::HandleHeterogeneousEqualityIn(const cel::Expr& expr,

Callers

nothing calls this directly

Calls 7

CreateDirectEqualityStepFunction · 0.85
CreateEqualityStepFunction · 0.85
argsMethod · 0.80
has_targetMethod · 0.80
sizeMethod · 0.45
has_valueMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected