From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 54B3F385842F; Sat, 15 Oct 2022 09:15:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54B3F385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665825353; bh=T9NKEhVEhF4vSfH85AzIeKFNOSLpq4T6IFkl57l2dG8=; h=From:To:Subject:Date:From; b=O6mWFP7c5KGGFwf/BBC/cREihgmhMyLoqiZLVWbet4SSZr3MzFFHvtkV+ZCdU2V2n vb7054VfhdmRrzd+WN+KmXyBeWuPDhJq+6oiTZwfOgWEIEpYhCxtix+P6eNTi5bre2 vNNqq4bU7ZmR0gApj4wLLmkQ5Jal3Z7c/+7ERxHI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] ast: dump: ArrayExpr X-Act-Checkin: gcc X-Git-Author: David Faust X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 191907df1fd4d09567cc1e05835564df727cfb13 X-Git-Newrev: 6927e3ee00d22bca1ef2d3e5e58a0705a7578067 Message-Id: <20221015091553.54B3F385842F@sourceware.org> Date: Sat, 15 Oct 2022 09:15:53 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6927e3ee00d22bca1ef2d3e5e58a0705a7578067 commit 6927e3ee00d22bca1ef2d3e5e58a0705a7578067 Author: David Faust Date: Thu Oct 13 10:14:38 2022 -0700 ast: dump: ArrayExpr Diff: --- gcc/rust/ast/rust-ast-dump.cc | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index ddc43b33512..91e540a1ee8 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)