@@ -49,62 +49,5 @@ class GlobbingVisitor : public AST::DefaultASTVisitor
49
49
NameResolutionContext &ctx;
50
50
};
51
51
52
- // TODO: Fix documentation
53
- // How do we do that?
54
- //
55
- // We want to resolve in the EarlyNameResolver, but we want to declare in the
56
- // TopLevel Should the TopLevel declare stubs? How does rustc do it? How to do
57
- // that for globbing? Should we do globbing afterwards once we've declared all
58
- // the Uses*?
59
- //
60
- // Basically, for each use declare it in a separate map - in the
61
- // EarlyNameResolver resolve and fix the ForeverStack? Emptying the maps each
62
- // time?
63
- //
64
- // e.g. TopLevel builds a std::vector<NodeId, SimplePath> use_trees_to_resolve;
65
- // Early goes through and resolves the SimplePath, then replaces the NodeId with
66
- // the resolved one? Do we even need to do that?
67
- //
68
- // rustc just creates an empty definition for the use tree.
69
- //
70
- // What about globbing? std::vector<GlobbulesPath> globules;
71
- // Early goes through and visits the module's path and calls the
72
- // GlobbingVisitor?
73
- //
74
- // the file `imports.rs` goes through and *finalizes* imports. So we can
75
- // probably add a FinalizeImport pass after the TopLevel and the Early.
76
- // - TopLevel takes care of declaring these use trees
77
- // - Early takes care of resolving them to definition points
78
- // - Finalize takes care of mapping the use's definition point to the actual
79
- // definition point
80
- // - We need to work more on that last bit to know exactly what is being
81
- // inserted, but probably it's going to mutate the ForeverStack - is that okay?
82
- // - Oh actually maybe no!
83
- // - TopLevel creates a map of UseTrees with paths to resolve. This should
84
- // probably be an ImportKind enum or whatever
85
- // - Early resolves them, creates a map of SimplePath with the associated
86
- // definition: Map<ImportKind, ImportData>
87
- // - Finalizes visits all UseTrees and inserts the Definitions found for
88
- // each ImportKind - easy!
89
- // - yay!
90
-
91
- class FinalizeImports : DefaultResolver
92
- {
93
- public:
94
- FinalizeImports (Early::ImportMappings &&data, TopLevel &toplevel,
95
- NameResolutionContext &ctx);
96
-
97
- void go (AST::Crate &crate);
98
-
99
- void visit (AST::UseDeclaration &) override ;
100
-
101
- private:
102
- using AST::DefaultASTVisitor::visit;
103
-
104
- Early::ImportMappings data;
105
- TopLevel &toplevel;
106
- NameResolutionContext &ctx;
107
- };
108
-
109
52
} // namespace Resolver2_0
110
53
} // namespace Rust
0 commit comments