summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-01 16:04:41 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-01 16:04:41 +0800
commitfef80b05ec09ac066ff0b474b80a8f55b8b4d217 (patch)
tree31ce99d09f1cbe26739a8ccc7d07c8fb182d91b2 /src/dump_as_rust.cpp
parent307e7704a977f023eb355ae1f03ba67a1084b39f (diff)
downloadmrust-fef80b05ec09ac066ff0b474b80a8f55b8b4d217.tar.gz
AST Dump - Include binding index in patterns
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r--src/dump_as_rust.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp
index 118cf234..db44ccbc 100644
--- a/src/dump_as_rust.cpp
+++ b/src/dump_as_rust.cpp
@@ -816,7 +816,9 @@ void RustPrinter::print_pattern_tuple(const AST::Pattern::TuplePat& v, bool is_r
void RustPrinter::print_pattern(const AST::Pattern& p, bool is_refutable)
{
if( p.binding().is_valid() ) {
- m_os << p.binding().m_name;
+ if( p.binding().m_mutable )
+ m_os << "mut ";
+ m_os << p.binding().m_name << "/*"<<p.binding().m_slot<<"*/";
// If binding is irrefutable, and would be binding against a wildcard, just emit the name
if( !is_refutable && p.data().is_Any() )
{