| 2143 | } |
| 2144 | |
| 2145 | void BinaryCondVisitor::PreVisit(const cel::Expr* expr) { |
| 2146 | switch (cond_) { |
| 2147 | case BinaryCond::kAnd: |
| 2148 | ABSL_FALLTHROUGH_INTENDED; |
| 2149 | case BinaryCond::kOr: |
| 2150 | visitor_->ValidateOrError( |
| 2151 | !expr->call_expr().has_target() && |
| 2152 | expr->call_expr().args().size() == 2, |
| 2153 | "Invalid argument count for a binary function call."); |
| 2154 | break; |
| 2155 | case BinaryCond::kOptionalOr: |
| 2156 | ABSL_FALLTHROUGH_INTENDED; |
| 2157 | case BinaryCond::kOptionalOrValue: |
| 2158 | visitor_->ValidateOrError(expr->call_expr().has_target() && |
| 2159 | expr->call_expr().args().size() == 1, |
| 2160 | "Invalid argument count for or/orValue call."); |
| 2161 | break; |
| 2162 | } |
| 2163 | } |
| 2164 | |
| 2165 | void BinaryCondVisitor::PostVisitArg(int arg_num, const cel::Expr* expr) { |
| 2166 | if (visitor_->PlanRecursiveProgram()) { |
no test coverage detected