summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-03-18 13:58:11 +0800
committerJohn Hodge <tpg@mutabah.net>2016-03-18 13:58:11 +0800
commit485dfcb3fe4ddfeb7c0342ec288807fde3ef9504 (patch)
treee027424cbe73fd799ac524bf82ddebc201fde8f8 /src/dump_as_rust.cpp
parent629fa5d38be99066f0fdb664796e9f7c6aea49ba (diff)
downloadmrust-485dfcb3fe4ddfeb7c0342ec288807fde3ef9504.tar.gz
AST - Switch traits to contain items
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r--src/dump_as_rust.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp
index 79ca0460..42cbf48e 100644
--- a/src/dump_as_rust.cpp
+++ b/src/dump_as_rust.cpp
@@ -949,13 +949,18 @@ void RustPrinter::handle_trait(const AST::Trait& s)
m_os << indent() << "{\n";
inc_indent();
- for( const auto& i : s.types() )
+ for( const auto& i : s.items() )
{
- m_os << indent() << "type " << i.name << ";\n";
- }
- for( const auto& i : s.functions() )
- {
- handle_function(false, i.name, i.data);
+ TU_MATCH_DEF(AST::Item, (i.data), (e),
+ (
+ ),
+ (Type,
+ m_os << indent() << "type " << i.name << ";\n";
+ ),
+ (Function,
+ handle_function(false, i.name, e.e);
+ )
+ )
}
dec_indent();