Files
carbon-lang/toolchain/check/handle_import_and_package.cpp
T
Jon Ross-Perkins 204c04dbb9 Add more package and import support. (#3402)
This should cover:

```
library "lib" api;
import Foo library default;
import library default;
import library "lib";
```

This splits out `PackageName` and `LibraryName` to their own parse nodes
so that checking can ignore them and still get a balanced parse tree
(otherwise, we essentially need to implement handling of the parse nodes
only to remove the identifiers/string literals -- the optional names
mean we can't blindly do that as before). For reference, these nodes
don't need to be handled because CheckParseTree will need to directly
funnel import information along with checked IRs.
2023-11-16 17:09:36 +00:00

73 lines
1.7 KiB
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "toolchain/check/context.h"
namespace Carbon::Check {
// `import` and `package` are structured by parsing. As a consequence, no
// checking logic is needed here.
auto HandleImportIntroducer(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandleImportDirective(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandleLibraryIntroducer(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandleLibraryDirective(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandlePackageIntroducer(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandlePackageDirective(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandleLibrarySpecifier(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandlePackageName(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandleLibraryName(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandleDefaultLibrary(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandlePackageApi(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
auto HandlePackageImpl(Context& /*context*/, Parse::Node /*parse_node*/)
-> bool {
return true;
}
} // namespace Carbon::Check