aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-dump.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-09-27 15:52:57 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-10-14 17:22:20 +0200
commitb6d4c62a84553f79fef12a9a5a9a305a560259dc (patch)
treeaf9364810fbbd3a9f5b12abaeb7d9f9020ff6a7c /gcc/rust/ast/rust-ast-dump.cc
parent85651630ad66b1e561453cdb28603eead88dd2ad (diff)
downloadgcc-b6d4c62a84553f79fef12a9a5a9a305a560259dc.zip
gcc-b6d4c62a84553f79fef12a9a5a9a305a560259dc.tar.gz
gcc-b6d4c62a84553f79fef12a9a5a9a305a560259dc.tar.bz2
dump: Dump items within modules
Diffstat (limited to 'gcc/rust/ast/rust-ast-dump.cc')
-rw-r--r--gcc/rust/ast/rust-ast-dump.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index 24dc808..d8e9c8d 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)