diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-02-24 13:17:15 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-02-24 13:17:15 +0800 |
commit | 1b173dc2281022b42560f169a5f7445ba9528f6c (patch) | |
tree | a34ac9ac247825fd609cc5ac34e7777bf219f18c /src/expand/mod.cpp | |
parent | 293badaed75dfff438ea5d15b1087c78ced8dbec (diff) | |
download | mrust-1b173dc2281022b42560f169a5f7445ba9528f6c.tar.gz |
Expand - Fix #61, not expanding paths in types
Diffstat (limited to 'src/expand/mod.cpp')
-rw-r--r-- | src/expand/mod.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp index d50a51fd..571d21e2 100644 --- a/src/expand/mod.cpp +++ b/src/expand/mod.cpp @@ -25,6 +25,7 @@ void Expand_Attrs(const ::AST::MetaItems& attrs, AttrStage stage, ::std::functi void Expand_Mod(::AST::Crate& crate, LList<const AST::Module*> modstack, ::AST::Path modpath, ::AST::Module& mod, unsigned int first_item = 0); void Expand_Expr(::AST::Crate& crate, LList<const AST::Module*> modstack, AST::Expr& node); void Expand_Expr(::AST::Crate& crate, LList<const AST::Module*> modstack, ::std::shared_ptr<AST::ExprNode>& node); +void Expand_Path(::AST::Crate& crate, LList<const AST::Module*> modstack, ::AST::Module& mod, ::AST::Path& p); void Register_Synext_Decorator(::std::string name, ::std::unique_ptr<ExpandDecorator> handler) { g_decorators.insert(::std::make_pair( mv$(name), mv$(handler) )); @@ -265,11 +266,19 @@ void Expand_Type(::AST::Crate& crate, LList<const AST::Module*> modstack, ::AST: (Generic, ), (Path, + Expand_Path(crate, modstack, mod, e.path); ), (TraitObject, + for(auto& p : e.traits) + { + Expand_Path(crate, modstack, mod, p); + } ), (ErasedType, - // TODO: Visit paths. + for(auto& p : e.traits) + { + Expand_Path(crate, modstack, mod, p); + } ) ) } |