MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / PreVisitCall

Method PreVisitCall

extensions/select_optimization.cc:429–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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()) {

Callers

nothing calls this directly

Calls 6

argsMethod · 0.80
has_const_exprMethod · 0.80
sizeMethod · 0.45
okMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected