mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 21:17:11 +00:00
fixes, optional type name added
This commit is contained in:
parent
d38d75c9d8
commit
0850e6aa6b
14 changed files with 163 additions and 99 deletions
|
|
@ -93,8 +93,6 @@ public:
|
|||
|
||||
std::optional<utils::IdType> FindLocalTypeId(const std::string& type);
|
||||
|
||||
std::optional<utils::IdType> FindAbstractTypeId(const std::string& abstract_type);
|
||||
|
||||
std::optional<utils::IdType> FindTypeclassId(const std::string& typeclass);
|
||||
|
||||
std::optional<utils::IdType> FindConstructorId(const std::optional<std::vector<std::string>>& path,
|
||||
|
|
@ -164,14 +162,6 @@ public:
|
|||
return global_info_.GetTypeInfo<T>(id.value());
|
||||
}
|
||||
|
||||
std::optional<definition::AbstractType*> FindAbstractType(const std::string& abstract_type) {
|
||||
std::optional<utils::IdType> id = FindAbstractTypeId(abstract_type);
|
||||
if (!id.has_value()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return &global_info_.GetAbstractTypeInfo(id.value());
|
||||
}
|
||||
|
||||
std::optional<definition::Typeclass*> FindTypeclass(const std::string& typeclass) {
|
||||
std::optional<utils::IdType> id = FindTypeclassId(typeclass);
|
||||
if (!id.has_value()) {
|
||||
|
|
@ -368,6 +358,16 @@ public:
|
|||
// function declarations & definitions should be added latter
|
||||
std::optional<utils::IdType> AddAnnotatedTypeToGraph(interpreter::tokens::AnnotatedType* node);
|
||||
|
||||
std::optional<utils::IdType> FindAbstractTypeId(const std::string& abstract_type);
|
||||
|
||||
std::optional<definition::AbstractType*> FindAbstractType(const std::string& abstract_type) {
|
||||
std::optional<utils::IdType> id = FindAbstractTypeId(abstract_type);
|
||||
if (!id.has_value()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return &GetAbstractTypeInfo(id.value());
|
||||
}
|
||||
|
||||
private:
|
||||
void CollectFunctionInfo(
|
||||
utils::IdType current_namespace,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue