From: David Faust Date: Thu, 13 Oct 2022 17:14:38 +0000 (-0700) Subject: gccrs: ast: dump: ArrayExpr X-Git-Tag: basepoints/gcc-14~1026 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f26e9ca3e9aa9ba9c03b3e76a0ced8350d8a7b69;p=thirdparty%2Fgcc.git gccrs: ast: dump: ArrayExpr gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Add dump code for ArrayExpr. --- diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index ddc43b335120..91e540a1ee88 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -449,19 +449,43 @@ Dump::visit (GroupedExpr &expr) void Dump::visit (ArrayElemsValues &elems) -{} +{ + auto &vals = elems.get_values (); + if (vals.size () >= 1) + { + vals[0]->accept_vis (*this); + for (size_t i = 1; i < vals.size (); i++) + { + stream << ", "; + vals[i]->accept_vis (*this); + } + } +} void Dump::visit (ArrayElemsCopied &elems) -{} +{ + elems.get_elem_to_copy ()->accept_vis (*this); + stream << "; "; + elems.get_num_copies ()->accept_vis (*this); +} void Dump::visit (ArrayExpr &expr) -{} +{ + stream << '['; + expr.get_array_elems ()->accept_vis (*this); + stream << ']'; +} void Dump::visit (ArrayIndexExpr &expr) -{} +{ + expr.get_array_expr ()->accept_vis (*this); + stream << '['; + expr.get_index_expr ()->accept_vis (*this); + stream << ']'; +} void Dump::visit (TupleExpr &expr)