diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-29 16:07:28 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-29 16:07:28 +0800 |
commit | 4c5e8ffbd413772859739e8cad57f925ba85dad8 (patch) | |
tree | d22427268aeee7a91b88ee1746845d7a1b74032d /src/ast | |
parent | a8da316a2646428acb780e889b322edf5f00549e (diff) | |
download | mrust-4c5e8ffbd413772859739e8cad57f925ba85dad8.tar.gz |
AST Resolve - Prelude handling
Diffstat (limited to 'src/ast')
-rw-r--r-- | src/ast/ast.hpp | 3 | ||||
-rw-r--r-- | src/ast/path.cpp | 17 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/ast/ast.hpp b/src/ast/ast.hpp index 362af210..9cf9b236 100644 --- a/src/ast/ast.hpp +++ b/src/ast/ast.hpp @@ -523,13 +523,14 @@ private: ::std::vector< Named<MacroRulesPtr> > m_macros;
public:
+ bool m_insert_prelude = true; // Set to false by `#[no_prelude]` handler
char m_index_populated = 0; // 0 = no, 1 = partial, 2 = complete
- // TODO: Add "namespace" list (separate to types)
struct IndexEnt {
bool is_pub; // Used as part of glob import checking
bool is_import; // Set if this item has a path that isn't `mod->path() + name`
::AST::Path path;
};
+ // TODO: Add "namespace" list (separate to types)
::std::unordered_map< ::std::string, IndexEnt > m_namespace_items;
::std::unordered_map< ::std::string, IndexEnt > m_type_items;
::std::unordered_map< ::std::string, IndexEnt > m_value_items;
diff --git a/src/ast/path.cpp b/src/ast/path.cpp index 58eadf24..132f0bb8 100644 --- a/src/ast/path.cpp +++ b/src/ast/path.cpp @@ -169,23 +169,6 @@ AST::Path::Path(const Path& x): ) memcpy(&m_binding, &x.m_binding, sizeof(PathBinding)); - //TU_MATCH(PathBinding, (x.m_binding), (ent), - //(Unbound, m_binding = PathBinding::make_Unbound({}); ), - //(Module, os << "Module"; ), - //(Trait, os << "Trait"; ), - //(Struct, os << "Struct"; ), - //(Enum, os << "Enum"; ), - //(Static, os << "Static"; ), - //(Function, os << "Function";), - //(EnumVar, os << "EnumVar(" << i.idx << ")"; ), - //(TypeAlias, os << "TypeAlias";), - //(StructMethod, os << "StructMethod"; ), - //(TraitMethod, os << "TraitMethod"; ), - // - //(TypeParameter, os << "TypeParameter(" << i.level << " # " << i.idx << ")"; ), - //(Variable, os << "Variable(" << i.slot << ")"; ) - //) - //DEBUG("clone, x = " << x << ", this = " << *this ); } |