diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-11 22:35:34 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-11 22:35:34 +0800 |
commit | be51cd50477cb3e65cb7720c91ed8ab5955d8872 (patch) | |
tree | 629ab5a7466c12c2dee101a5a9291e2dff4c951b | |
parent | 2643d3a78812440d9b95ff37e47186f9bcba9201 (diff) | |
download | mrust-be51cd50477cb3e65cb7720c91ed8ab5955d8872.tar.gz |
AST Dump - Include binding types
-rw-r--r-- | src/dump_as_rust.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp index b8443845..c26698f5 100644 --- a/src/dump_as_rust.cpp +++ b/src/dump_as_rust.cpp @@ -821,6 +821,17 @@ void RustPrinter::print_pattern(const AST::Pattern& p, bool is_refutable) if( p.binding().is_valid() ) { if( p.binding().m_mutable ) m_os << "mut "; + switch(p.binding().m_type) + { + case ::AST::PatternBinding::Type::MOVE: + break; + case ::AST::PatternBinding::Type::REF: + m_os << "ref "; + break; + case ::AST::PatternBinding::Type::MUTREF: + m_os << "ref mut "; + break; + } 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() ) |