diff options
author | John Hodge <tpg@mutabah.net> | 2016-02-18 21:34:00 +1100 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-02-18 21:34:00 +1100 |
commit | e674cb99edf50de91f8f5aed3188e30ffb7c88d7 (patch) | |
tree | ce0dac42a5798b247ad8f9ee24842f5d0c2e4531 /src/dump_as_rust.cpp | |
parent | cf87314dde3af9468f3e24e29191412e8a2d19f7 (diff) | |
download | mrust-e674cb99edf50de91f8f5aed3188e30ffb7c88d7.tar.gz |
Parser - box Patterns, edge bug fix
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r-- | src/dump_as_rust.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp index 11ace14b..a498e626 100644 --- a/src/dump_as_rust.cpp +++ b/src/dump_as_rust.cpp @@ -746,9 +746,17 @@ void RustPrinter::print_pattern(const AST::Pattern& p, bool is_refutable) (MaybeBind, m_os << "_ /*?*/"; ), + (Box, { + const auto& v = p.data().as_Box(); + m_os << "& "; + print_pattern(*v.sub, is_refutable); + }), (Ref, { const auto& v = p.data().as_Ref(); - m_os << "& "; + if(v.mut) + m_os << "&mut "; + else + m_os << "& "; print_pattern(*v.sub, is_refutable); }), (Value, { |