diff options
Diffstat (limited to 'gcc/rust/resolve/rust-early-name-resolver-2.0.h')
-rw-r--r-- | gcc/rust/resolve/rust-early-name-resolver-2.0.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.h b/gcc/rust/resolve/rust-early-name-resolver-2.0.h index a7ad0f7..c4226fe 100644 --- a/gcc/rust/resolve/rust-early-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.h @@ -34,6 +34,7 @@ class Early : public DefaultResolver { using DefaultResolver::visit; + TopLevel toplevel; bool dirty; public: @@ -59,6 +60,7 @@ public: void visit (AST::Function &) override; void visit (AST::StructStruct &) override; + void visit (AST::UseDeclaration &) override; struct ImportData { @@ -227,9 +229,12 @@ private: }; }; - ctx.values.resolve_path (segments).map (pair_with_ns (Namespace::Values)); - ctx.types.resolve_path (segments).map (pair_with_ns (Namespace::Types)); - ctx.macros.resolve_path (segments).map (pair_with_ns (Namespace::Macros)); + ctx.resolve_path (segments, Namespace::Values) + .map (pair_with_ns (Namespace::Values)); + ctx.resolve_path (segments, Namespace::Types) + .map (pair_with_ns (Namespace::Types)); + ctx.resolve_path (segments, Namespace::Macros) + .map (pair_with_ns (Namespace::Macros)); return resolved; } @@ -243,6 +248,13 @@ private: std::vector<Error> macro_resolve_errors; void collect_error (Error e) { macro_resolve_errors.push_back (e); } + + void finalize_simple_import (const Early::ImportPair &mapping); + + void finalize_glob_import (NameResolutionContext &ctx, + const Early::ImportPair &mapping); + + void finalize_rebind_import (const Early::ImportPair &mapping); }; } // namespace Resolver2_0 |