| 130 | } |
| 131 | |
| 132 | absl::Status CallExprToProto(const Expr& expr, const CallExpr& call_expr, |
| 133 | ExprProto* absl_nonnull proto) { |
| 134 | proto->Clear(); |
| 135 | auto* call_proto = proto->mutable_call_expr(); |
| 136 | proto->set_id(expr.id()); |
| 137 | if (call_expr.has_target()) { |
| 138 | Push(call_expr.target(), call_proto->mutable_target()); |
| 139 | } |
| 140 | call_proto->set_function(call_expr.function()); |
| 141 | if (!call_expr.args().empty()) { |
| 142 | call_proto->mutable_args()->Reserve( |
| 143 | static_cast<int>(call_expr.args().size())); |
| 144 | for (const auto& argument : call_expr.args()) { |
| 145 | Push(argument, call_proto->add_args()); |
| 146 | } |
| 147 | } |
| 148 | return absl::OkStatus(); |
| 149 | } |
| 150 | |
| 151 | absl::Status ListExprToProto(const Expr& expr, const ListExpr& list_expr, |
| 152 | ExprProto* absl_nonnull proto) { |
nothing calls this directly
no test coverage detected