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

Method Evaluate

eval/public/comparison_functions_test.cc:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 CelFunctionRegistry& registry() { return *builder_->GetRegistry(); }
73
74 absl::StatusOr<CelValue> Evaluate(absl::string_view expr, const CelValue& lhs,
75 const CelValue& rhs) {
76 CEL_ASSIGN_OR_RETURN(ParsedExpr parsed_expr, parser::Parse(expr));
77 Activation activation;
78 activation.InsertValue("lhs", lhs);
79 activation.InsertValue("rhs", rhs);
80
81 CEL_ASSIGN_OR_RETURN(auto expression,
82 builder_->CreateExpression(
83 &parsed_expr.expr(), &parsed_expr.source_info()));
84
85 return expression->Evaluate(activation, &arena_);
86 }
87
88 protected:
89 std::unique_ptr<CelExpressionBuilder> builder_;

Callers

nothing calls this directly

Calls 1

InsertValueMethod · 0.80

Tested by

no test coverage detected