From: Arthur Cohen Date: Tue, 27 Sep 2022 13:52:57 +0000 (+0200) Subject: gccrs: dump: Dump items within modules X-Git-Tag: basepoints/gcc-14~1019 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31150a6366dbd5b3028ffd99942d8a84081c7842;p=thirdparty%2Fgcc.git gccrs: dump: Dump items within modules gcc/rust/ChangeLog: * ast/rust-ast-dump.cc (Dump::visit): Dump items in modules properly. --- diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index b7557bdee0cb..653c1d9ff038 100644 --- a/gcc/rust/ast/rust-ast-dump.cc +++ b/gcc/rust/ast/rust-ast-dump.cc @@ -809,7 +809,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)