diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-25 09:47:05 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-25 09:47:05 +0800 |
commit | b1144525fc8a33718c8ca239b801ccbad5589f25 (patch) | |
tree | 651b5051fad208ace8a7e12bc849dfdcdd1dec0c | |
parent | ce9f6edce92d1579a4ea108a5fc6aa58971400d4 (diff) | |
download | mrust-b1144525fc8a33718c8ca239b801ccbad5589f25.tar.gz |
HIR Dump - Don't print `mod {}` for root
-rw-r--r-- | src/hir/dump.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp index 32851fd5..5291b948 100644 --- a/src/hir/dump.cpp +++ b/src/hir/dump.cpp @@ -29,14 +29,20 @@ namespace { void visit_module(::HIR::ItemPath p, ::HIR::Module& mod) override { - m_os << indent() << "mod " << p.get_name() << " {\n"; - inc_indent(); + if( p.get_name()[0] ) + { + m_os << indent() << "mod " << p.get_name() << " {\n"; + inc_indent(); + } // TODO: Print publicitiy. ::HIR::Visitor::visit_module(p, mod); - dec_indent(); - m_os << indent() << "}\n"; + if( p.get_name()[0] ) + { + dec_indent(); + m_os << indent() << "}\n"; + } } void visit_type_impl(::HIR::TypeImpl& impl) override |