diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-01 16:04:41 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-01 16:04:41 +0800 |
commit | fef80b05ec09ac066ff0b474b80a8f55b8b4d217 (patch) | |
tree | 31ce99d09f1cbe26739a8ccc7d07c8fb182d91b2 /src/dump_as_rust.cpp | |
parent | 307e7704a977f023eb355ae1f03ba67a1084b39f (diff) | |
download | mrust-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.cpp | 4 |
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() ) { |