public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] dump: Dump items within modules
@ 2022-10-15 9:16 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-10-15 9:16 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b6d4c62a84553f79fef12a9a5a9a305a560259dc
commit b6d4c62a84553f79fef12a9a5a9a305a560259dc
Author: Arthur Cohen <arthur.cohen@embecosm.com>
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-15 9:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-15 9:16 [gcc/devel/rust/master] dump: Dump items within modules Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).