| 726 | enable_select_optimization_(enable_select_optimization) {} |
| 727 | |
| 728 | static absl::StatusOr<std::unique_ptr<cel::TraceableProgram>> Plan( |
| 729 | const cel::Runtime& runtime, |
| 730 | const conformance::v1alpha1::EvalRequest& request) { |
| 731 | std::unique_ptr<cel::Ast> ast; |
| 732 | if (request.has_parsed_expr()) { |
| 733 | cel::expr::ParsedExpr unversioned; |
| 734 | ABSL_CHECK(ConvertWireCompatProto(request.parsed_expr(), // Crash OK |
| 735 | &unversioned)); |
| 736 | |
| 737 | CEL_ASSIGN_OR_RETURN( |
| 738 | ast, cel::CreateAstFromParsedExpr(std::move(unversioned))); |
| 739 | |
| 740 | } else if (request.has_checked_expr()) { |
| 741 | cel::expr::CheckedExpr unversioned; |
| 742 | ABSL_CHECK(ConvertWireCompatProto(request.checked_expr(), // Crash OK |
| 743 | &unversioned)); |
| 744 | CEL_ASSIGN_OR_RETURN( |
| 745 | ast, cel::CreateAstFromCheckedExpr(std::move(unversioned))); |
| 746 | } |
| 747 | if (ast == nullptr) { |
| 748 | return absl::InternalError("no expression provided"); |
| 749 | } |
| 750 | |
| 751 | return runtime.CreateTraceableProgram(std::move(ast)); |
| 752 | } |
| 753 | |
| 754 | RuntimeOptions options_; |
| 755 | bool enable_optimizations_; |
nothing calls this directly
no test coverage detected