mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Refactor checking flow to allow for ordering based on import/package. (#3379)
As I was working on this, I noticed `import` and `library` syntax needs to be fixed for how it imports the current package, and for `Main` libraries. This mostly reflects the current state in its testing. Otherwise, this should handle most of the errors I could think of: dependency cycles, redundant imports, etc. It does not actually deal with the nuances of cross-IR references. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
09b5ab14d8
commit
d024403dc4
@@ -300,6 +300,19 @@ class Context {
|
||||
auto RecoverFromDeclError(StateStackEntry state, NodeKind parse_node_kind,
|
||||
bool skip_past_likely_end) -> void;
|
||||
|
||||
// Sets the package directive information. Called at most once.
|
||||
auto set_packaging_directive(Tree::PackagingNames packaging_names,
|
||||
Tree::ApiOrImpl api_or_impl) -> void {
|
||||
CARBON_CHECK(!tree_->packaging_directive_);
|
||||
tree_->packaging_directive_ = {.names = packaging_names,
|
||||
.api_or_impl = api_or_impl};
|
||||
}
|
||||
|
||||
// Adds an import.
|
||||
auto AddImport(Tree::PackagingNames package) -> void {
|
||||
tree_->imports_.push_back(package);
|
||||
}
|
||||
|
||||
// Prints information for a stack dump.
|
||||
auto PrintForStackDump(llvm::raw_ostream& output) const -> void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user