diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-21 16:37:38 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-21 16:37:38 +0800 |
commit | 10f602cabec44841bb947a185dd196d1107c97d9 (patch) | |
tree | 0e0bd7ba862d1a1687d2656999ce0d4045de8621 /src/hir/dump.cpp | |
parent | 98fc6081de028002122de892b6c343d8b4d20961 (diff) | |
download | mrust-10f602cabec44841bb947a185dd196d1107c97d9.tar.gz |
HIR Dump - Fix printing of closures (that don't contain a block)
Diffstat (limited to 'src/hir/dump.cpp')
-rw-r--r-- | src/hir/dump.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/hir/dump.cpp b/src/hir/dump.cpp index f5788ca3..32851fd5 100644 --- a/src/hir/dump.cpp +++ b/src/hir/dump.cpp @@ -208,7 +208,21 @@ namespace { if( item.m_code ) { m_os << indent(); - item.m_code->visit( *this ); + if( dynamic_cast< ::HIR::ExprNode_Block*>(&*item.m_code) ) { + item.m_code->visit( *this ); + } + else { + m_os << "{\n"; + inc_indent(); + m_os << indent(); + + item.m_code->visit( *this ); + + m_os << "\n"; + dec_indent(); + m_os << indent(); + m_os << "}"; + } m_os << "\n"; } else |