| 427 | } |
| 428 | |
| 429 | void PreVisitCall(const Expr& expr, const CallExpr& call) override { |
| 430 | if (call.args().size() != 2 || call.function() != ::cel::builtin::kIndex) { |
| 431 | return; |
| 432 | } |
| 433 | |
| 434 | const auto& qualifier_expr = call.args()[1]; |
| 435 | if (qualifier_expr.has_const_expr()) { |
| 436 | auto qualifier_or = |
| 437 | SelectInstructionFromConstant(qualifier_expr.const_expr()); |
| 438 | if (!qualifier_or.ok()) { |
| 439 | // TODO(uncreated-issue/54): should warn, but by default warnings fail overall |
| 440 | // program planning. |
| 441 | return; |
| 442 | } |
| 443 | candidates_[&expr] = std::move(qualifier_or).value(); |
| 444 | } |
| 445 | // TODO(uncreated-issue/54): support variable indexes |
| 446 | } |
| 447 | |
| 448 | bool PostVisitRewrite(Expr& expr) override { |
| 449 | if (!progress_status_.ok()) { |
nothing calls this directly
no test coverage detected