diff options
author | David Faust <david.faust@oracle.com> | 2022-10-13 10:14:38 -0700 |
---|---|---|
committer | David Faust <david.faust@oracle.com> | 2022-10-13 13:35:56 -0700 |
commit | 6927e3ee00d22bca1ef2d3e5e58a0705a7578067 (patch) | |
tree | 269c1a14ace8de675a0aa9003f8a624ec9a19e8c | |
parent | 191907df1fd4d09567cc1e05835564df727cfb13 (diff) | |
download | gcc-6927e3ee00d22bca1ef2d3e5e58a0705a7578067.zip gcc-6927e3ee00d22bca1ef2d3e5e58a0705a7578067.tar.gz gcc-6927e3ee00d22bca1ef2d3e5e58a0705a7578067.tar.bz2 |
ast: dump: ArrayExpr
-rw-r--r-- | gcc/rust/ast/rust-ast-dump.cc | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index ddc43b3..91e540a 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) |