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

Method PreVisit

eval/compiler/flat_expr_builder.cc:2145–2163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2143}
2144
2145void 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
2165void BinaryCondVisitor::PostVisitArg(int arg_num, const cel::Expr* expr) {
2166 if (visitor_->PlanRecursiveProgram()) {

Callers 2

PreVisitCallMethod · 0.80
PreVisitComprehensionMethod · 0.80

Calls 5

ValidateOrErrorMethod · 0.80
has_targetMethod · 0.80
argsMethod · 0.80
SuppressBranchMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected