| 247 | } |
| 248 | |
| 249 | absl::Status Unparser::VisitCall(const Expr::Call& expr) { |
| 250 | const auto& fun = expr.function(); |
| 251 | absl::optional<std::string> op = LookupUnaryOperator(fun); |
| 252 | if (op.has_value()) { |
| 253 | return VisitUnary(expr, *op); |
| 254 | } |
| 255 | |
| 256 | op = LookupBinaryOperator(fun); |
| 257 | if (op.has_value()) { |
| 258 | return VisitBinary(expr, *op); |
| 259 | } |
| 260 | |
| 261 | if (fun == CelOperator::INDEX) { |
| 262 | return VisitIndex(expr); |
| 263 | } |
| 264 | |
| 265 | if (fun == CelOperator::OPT_INDEX) { |
| 266 | return VisitOptIndex(expr); |
| 267 | } |
| 268 | |
| 269 | if (fun == CelOperator::OPT_SELECT) { |
| 270 | return VisitOptSelect(expr); |
| 271 | } |
| 272 | |
| 273 | if (fun == CelOperator::CONDITIONAL) { |
| 274 | return VisitTernary(expr); |
| 275 | } |
| 276 | |
| 277 | if (expr.has_target()) { |
| 278 | bool nested = IsBinaryOrTernaryOperator(expr.target()); |
| 279 | CEL_RETURN_IF_ERROR(VisitMaybeNested(expr.target(), nested)); |
| 280 | Print(kDot); |
| 281 | } |
| 282 | Print(fun, kLeftParen); |
| 283 | for (int i = 0; i < expr.args_size(); i++) { |
| 284 | if (i > 0) { |
| 285 | Print(kComma, kSpace); |
| 286 | } |
| 287 | CEL_RETURN_IF_ERROR(Visit(expr.args(i))); |
| 288 | } |
| 289 | Print(kRightParen); |
| 290 | return absl::OkStatus(); |
| 291 | } |
| 292 | |
| 293 | absl::Status Unparser::VisitCreateList(const Expr::CreateList& expr) { |
| 294 | Print(kLeftBracket); |
nothing calls this directly
no test coverage detected