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

Method VisitOptSelect

tools/cel_unparser.cc:235–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235absl::Status Unparser::VisitOptSelect(const Expr::Call& expr) {
236 if (expr.args_size() != 2 || !expr.args()[1].has_const_expr() ||
237 !expr.args()[1].const_expr().has_string_value()) {
238 return absl::InvalidArgumentError(
239 absl::StrCat("Unexpected select: ", expr.ShortDebugString()));
240 }
241 const auto& operand = expr.args()[0];
242 bool nested = IsBinaryOrTernaryOperator(operand);
243 CEL_RETURN_IF_ERROR(VisitMaybeNested(operand, nested));
244 Print(kDot, kQuestionMark,
245 FormatField(expr.args()[1].const_expr().string_value()));
246 return absl::OkStatus();
247}
248
249absl::Status Unparser::VisitCall(const Expr::Call& expr) {
250 const auto& fun = expr.function();

Callers

nothing calls this directly

Calls 3

FormatFieldFunction · 0.85
has_const_exprMethod · 0.80
argsMethod · 0.80

Tested by

no test coverage detected