diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-01 14:22:52 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-01 14:22:52 +0800 |
commit | 258f1d3894a8261e2bf3d6528093c152ad53c4b0 (patch) | |
tree | 1737be382ecfed4e782d27897055633789d4939a /src/dump_as_rust.cpp | |
parent | b613f53aecc651ca36b550345175554d2d2def8d (diff) | |
download | mrust-258f1d3894a8261e2bf3d6528093c152ad53c4b0.tar.gz |
AST - Remove Expr from patterns (replace with local Value type)
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r-- | src/dump_as_rust.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp index 357795c5..361bd245 100644 --- a/src/dump_as_rust.cpp +++ b/src/dump_as_rust.cpp @@ -801,14 +801,12 @@ void RustPrinter::print_pattern(const AST::Pattern& p, bool is_refutable) m_os << "& "; print_pattern(*v.sub, is_refutable); }), - (Value, { - auto& v = p.data().as_Value(); - v.start->visit(*this); - if( v.end.get() ) { - m_os << " ... "; - v.end->visit(*this); + (Value, + m_os << v.start; + if( ! v.end.is_Invalid() ) { + m_os << " ... " << v.end; } - }), + ), (StructTuple, { const auto& v = p.data().as_StructTuple(); m_os << v.path << "("; |