summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-05-01 14:22:52 +0800
committerJohn Hodge <tpg@mutabah.net>2016-05-01 14:22:52 +0800
commit258f1d3894a8261e2bf3d6528093c152ad53c4b0 (patch)
tree1737be382ecfed4e782d27897055633789d4939a /src/dump_as_rust.cpp
parentb613f53aecc651ca36b550345175554d2d2def8d (diff)
downloadmrust-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.cpp12
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 << "(";