mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
.
This commit is contained in:
parent
648f78afa3
commit
496d3819d9
6 changed files with 71 additions and 16 deletions
|
|
@ -18,6 +18,11 @@ public:
|
|||
friend GlobalInfo;
|
||||
NamespaceVisitor() = delete;
|
||||
public:
|
||||
struct Path {
|
||||
std::vector<std::optional<utils::IdType>> path_types;
|
||||
definition::Namespace* result;
|
||||
}
|
||||
|
||||
void AddImport(definition::Import&& import_info, const std::optional<std::string>& name = std::nullopt);
|
||||
|
||||
void AddEnterNamespace(const std::string& name,
|
||||
|
|
@ -57,6 +62,8 @@ public:
|
|||
std::optional<utils::IdType> FindType(const std::optional<std::vector<std::string>>& path,
|
||||
const std::string& type);
|
||||
|
||||
std::optional<utils::IdType> FindLocalType(const std::string& type);
|
||||
|
||||
std::optional<utils::IdType> FindAbstractType(const std::string& abstract_type);
|
||||
|
||||
std::optional<utils::IdType> FindTypeclass(const std::string& typeclass);
|
||||
|
|
@ -96,22 +103,22 @@ public:
|
|||
return NamespaceVisitor(*this);
|
||||
}
|
||||
|
||||
// TODO: remember about vector realloc
|
||||
// remember about vector realloc
|
||||
definition::Function* GetFunctionInfo(utils::IdType id) {
|
||||
return &functions_[id];
|
||||
}
|
||||
|
||||
// TODO: remember about vector realloc
|
||||
// remember about vector realloc
|
||||
definition::Type* GetTypeInfo(utils::IdType id) {
|
||||
return &types_[id];
|
||||
}
|
||||
|
||||
// TODO: remember about vector realloc
|
||||
// remember about vector realloc
|
||||
definition::Typeclass* GetTypeclassInfo(utils::IdType id) {
|
||||
return &typeclasses_[id];
|
||||
}
|
||||
|
||||
// TODO: remember about vector realloc
|
||||
// remember about vector realloc
|
||||
definition::Constructor* GetConstructorInfo(utils::IdType id) {
|
||||
return &constructors_[id];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue