| 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_; |
nothing calls this directly
no test coverage detected