From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id AB554385842F; Sat, 15 Oct 2022 09:16:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB554385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665825378; bh=sKsj36UDOj1MCELi9lqFgToQpMjSlyxGSL2j004+zbg=; h=From:To:Subject:Date:From; b=HfdF4l2XyowvTYDjBfzZEU4kUdH++0QOJ7CqxMnR74fFc+prft7VD9lYM6rJKlGVv +6JhvaNP8Fdf90l5dZNzRXMUoKVbmB8GyLpd4vyLZ5AdDnltUdcN9kBqnvlSj0p35R j9XPbsosEB7bvVT5av0q9jDij+fQuhXMpPvGrnC0= 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] dump: Dump items within modules X-Act-Checkin: gcc X-Git-Author: Arthur Cohen X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 85651630ad66b1e561453cdb28603eead88dd2ad X-Git-Newrev: b6d4c62a84553f79fef12a9a5a9a305a560259dc Message-Id: <20221015091618.AB554385842F@sourceware.org> Date: Sat, 15 Oct 2022 09:16:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b6d4c62a84553f79fef12a9a5a9a305a560259dc commit b6d4c62a84553f79fef12a9a5a9a305a560259dc Author: Arthur Cohen Date: Tue Sep 27 15:52:57 2022 +0200 dump: Dump items within modules Diff: --- gcc/rust/ast/rust-ast-dump.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index 24dc808707f..d8e9c8d0511 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -683,7 +683,23 @@ Dump::visit (Method &method) void Dump::visit (Module &module) -{} +{ + indentation.increment (); + + stream << indentation; + emit_visibility (module.get_visibility ()); + stream << "mod" << module.get_name () << " {\n"; + + for (auto &item : module.get_items ()) + { + stream << indentation; + item->accept_vis (*this); + stream << '\n'; + } + + indentation.decrement (); + stream << indentation << "}\n"; +} void Dump::visit (ExternCrate &crate)