| 107 | } // namespace |
| 108 | |
| 109 | absl::StatusOr<bool> CompileAndEvaluateWithBoolVar(absl::string_view cel_expr, |
| 110 | bool bool_var) { |
| 111 | CEL_ASSIGN_OR_RETURN(std::unique_ptr<cel::Compiler> compiler, |
| 112 | MakeCelCompiler()); |
| 113 | |
| 114 | CEL_ASSIGN_OR_RETURN(CheckedExpr checked_expr, |
| 115 | CompileToCheckedExpr(*compiler, cel_expr)); |
| 116 | |
| 117 | Activation activation; |
| 118 | google::protobuf::Arena arena; |
| 119 | // === Start Codelab === |
| 120 | // Update the activation to bind the bool argument to 'bool_var' |
| 121 | // === End Codelab === |
| 122 | |
| 123 | return EvalCheckedExpr(checked_expr, activation, &arena); |
| 124 | } |
| 125 | |
| 126 | absl::StatusOr<bool> CompileAndEvaluateWithContext( |
| 127 | absl::string_view cel_expr, const AttributeContext& context) { |