diff options
author | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-18 14:50:41 +0800 |
---|---|---|
committer | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-18 14:50:41 +0800 |
commit | 1e2b0cc4fc9ce65ffe8212c9feca4eec945b46f3 (patch) | |
tree | a3f121275fd0778b87daba5552fd1b5f892d3455 /src/convert/ast_iterate.cpp | |
parent | 0e61ec5eafddb980eac2d6577b2e20af9aceae02 (diff) | |
download | mrust-1e2b0cc4fc9ce65ffe8212c9feca4eec945b46f3.tar.gz |
Add handlers for more item types to AST iterator, fix bad name in std
Diffstat (limited to 'src/convert/ast_iterate.cpp')
-rw-r--r-- | src/convert/ast_iterate.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/convert/ast_iterate.cpp b/src/convert/ast_iterate.cpp index 1e01d37d..f9d1f927 100644 --- a/src/convert/ast_iterate.cpp +++ b/src/convert/ast_iterate.cpp @@ -98,6 +98,16 @@ void CASTIterator::handle_module(AST::Path path, AST::Module& mod) DEBUG("Handling function '" << fcn.name << "'"); handle_function(path + fcn.name, fcn.data); } + for( auto& item : mod.structs() ) + { + DEBUG("Handling struct " << item.name); + handle_struct(path + item.name, item.data); + } + for( auto& item : mod.enums() ) + { + DEBUG("Handling enum " << item.name); + handle_enum(path + item.name, item.data); + } for( auto& impl : mod.impls() ) { @@ -158,10 +168,17 @@ void CASTIterator::handle_impl(AST::Path modpath, AST::Impl& impl) void CASTIterator::handle_struct(AST::Path path, AST::Struct& str) { + handle_params( str.params() ); + for( auto& f : str.fields() ) + handle_type( f.second ); } void CASTIterator::handle_enum(AST::Path path, AST::Enum& enm) { + handle_params( enm.params() ); + for( auto& f : enm.variants() ) + handle_type( f.second ); } void CASTIterator::handle_alias(AST::Path path, AST::TypeAlias& alias) { + throw ::std::runtime_error("TODO - handle_alias"); } |