| 81 | } |
| 82 | |
| 83 | absl::StatusOr<std::unique_ptr<CelExpression>> |
| 84 | CelExpressionBuilderFlatImpl::CreateExpressionImpl( |
| 85 | std::unique_ptr<Ast> converted_ast, |
| 86 | std::vector<absl::Status>* warnings) const { |
| 87 | std::vector<RuntimeIssue> issues; |
| 88 | auto* issues_ptr = (warnings != nullptr) ? &issues : nullptr; |
| 89 | |
| 90 | CEL_ASSIGN_OR_RETURN(FlatExpression impl, |
| 91 | flat_expr_builder_.CreateExpressionImpl( |
| 92 | std::move(converted_ast), issues_ptr)); |
| 93 | |
| 94 | if (issues_ptr != nullptr) { |
| 95 | for (const auto& issue : issues) { |
| 96 | warnings->push_back(issue.ToStatus()); |
| 97 | } |
| 98 | } |
| 99 | if (flat_expr_builder_.options().max_recursion_depth != 0 && |
| 100 | !impl.subexpressions().empty() && |
| 101 | // mainline expression is exactly one recursive step. |
| 102 | impl.subexpressions().front().size() == 1 && |
| 103 | impl.subexpressions().front().front()->GetNativeTypeId() == |
| 104 | cel::NativeTypeId::For<WrappedDirectStep>()) { |
| 105 | return CelExpressionRecursiveImpl::Create(env_, std::move(impl)); |
| 106 | } |
| 107 | |
| 108 | return std::make_unique<CelExpressionFlatImpl>(env_, std::move(impl)); |
| 109 | } |
| 110 | |
| 111 | } // namespace google::api::expr::runtime |
nothing calls this directly
no test coverage detected