diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dump_as_rust.cpp | 7 | ||||
-rw-r--r-- | src/types.cpp | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp index b8fb1647..f3fd8f83 100644 --- a/src/dump_as_rust.cpp +++ b/src/dump_as_rust.cpp @@ -221,7 +221,10 @@ public: AST::NodeVisitor::visit(arm.m_cond); } m_os << " => "; + // Increase indent, but don't print. Causes nested blocks to be indented above the match + inc_indent(); AST::NodeVisitor::visit(arm.m_code); + dec_indent(); m_os << ",\n"; } @@ -299,8 +302,9 @@ public: m_os << ": "; print_type(arg.second); } - m_os << "|: "; + m_os << "| ->"; print_type(n.m_return); + m_os << " "; AST::NodeVisitor::visit(n.m_code); } virtual void visit(AST::ExprNode_Integer& n) override { @@ -558,6 +562,7 @@ void RustPrinter::handle_module(const AST::Module& mod) m_os << " = " << i.data.type(); print_bounds(i.data.params()); m_os << ";\n"; + m_os << "\n"; } need_nl = true; diff --git a/src/types.cpp b/src/types.cpp index 4082bc96..101a3971 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -397,7 +397,10 @@ bool TypeRef::operator==(const TypeRef& x) const break; case TypeRef::TUPLE: //os << "TagTuple, {" << tr.m_inner_types << "}"; - os << "(" << tr.m_inner_types << ",)"; + os << "( "; + for( const auto& it : tr.m_inner_types ) + os << it << ", "; + os << ")"; break; case TypeRef::REFERENCE: //os << "TagReference, " << (tr.m_is_inner_mutable ? "mut" : "const") << ", " << tr.m_inner_types[0]; |