summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-13 23:11:34 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-13 23:11:34 +0800
commit2cd588ca7d71b00c93429c733ce28d78cdd415eb (patch)
tree78907803c465d44fbfb4a7c6e23e8860ac060257 /src/dump_as_rust.cpp
parent1e77e4894c4355272de8d0bfe391a29d44608604 (diff)
downloadmrust-2cd588ca7d71b00c93429c733ce28d78cdd415eb.tar.gz
Various other features for libcore, now on to loops
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r--src/dump_as_rust.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp
index fe432268..76bb99b4 100644
--- a/src/dump_as_rust.cpp
+++ b/src/dump_as_rust.cpp
@@ -343,6 +343,8 @@ public:
case AST::ExprNode_BinOp::MULTIPLY: m_os << "*"; break;
case AST::ExprNode_BinOp::DIVIDE: m_os << "/"; break;
case AST::ExprNode_BinOp::MODULO: m_os << "%"; break;
+ case AST::ExprNode_BinOp::ADD: m_os << "+"; break;
+ case AST::ExprNode_BinOp::SUB: m_os << "-"; break;
}
m_os << " ";
if( IS(*n.m_right, AST::ExprNode_BinOp) )
@@ -565,6 +567,10 @@ void RustPrinter::print_pattern(const AST::Pattern& p)
case AST::Pattern::ANY:
m_os << "_";
break;
+ case AST::Pattern::REF:
+ m_os << "& ";
+ print_pattern(p.sub_patterns()[0]);
+ break;
case AST::Pattern::VALUE:
m_os << p.node();
break;