| 157 | } // namespace |
| 158 | |
| 159 | absl::StatusOr<bool> EvaluateWithExtensionFunction( |
| 160 | absl::string_view expr, const AttributeContext& context) { |
| 161 | // Prepare a checked expression. |
| 162 | CEL_ASSIGN_OR_RETURN(std::unique_ptr<cel::Compiler> compiler, |
| 163 | MakeConfiguredCompiler()); |
| 164 | CEL_ASSIGN_OR_RETURN(auto checked_expr, |
| 165 | CompileToCheckedExpr(*compiler, expr)); |
| 166 | |
| 167 | // Prepare an evaluation environment. |
| 168 | Evaluator evaluator; |
| 169 | CEL_RETURN_IF_ERROR(evaluator.SetupEvaluatorEnvironment()); |
| 170 | |
| 171 | // Evaluate a checked expression against a particular activation |
| 172 | return evaluator.Evaluate(checked_expr, context); |
| 173 | } |
| 174 | |
| 175 | } // namespace cel_codelab |
nothing calls this directly
no test coverage detected