mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
namespace storage fix, namespace enter fix, maybe other fixes
This commit is contained in:
parent
4882d458f8
commit
4b4756b657
11 changed files with 250 additions and 174 deletions
|
|
@ -32,7 +32,8 @@ public:
|
|||
bool operator<(const AbstractType& type) const;
|
||||
bool operator>(const AbstractType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
private:
|
||||
utils::AbstractTypeModifier modifier_;
|
||||
|
|
@ -45,6 +46,7 @@ public:
|
|||
DefinedType() = default;
|
||||
DefinedType(utils::IdType type_id,
|
||||
utils::IdType type,
|
||||
utils::ClassModifier class_modifier,
|
||||
TypeManager* type_manager)
|
||||
: type_id_(type_id), type_(type), type_manager_(type_manager) {}
|
||||
|
||||
|
|
@ -53,7 +55,8 @@ public:
|
|||
bool operator<(const DefinedType& type) const;
|
||||
bool operator>(const DefinedType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
utils::IdType GetTypeId() const {
|
||||
return type_id_;
|
||||
|
|
@ -63,9 +66,14 @@ public:
|
|||
return type_;
|
||||
}
|
||||
|
||||
utils::ClassModifier GetClassModifier() const {
|
||||
return class_modifier_;
|
||||
}
|
||||
|
||||
private:
|
||||
utils::IdType type_id_; // in defined types
|
||||
utils::IdType type_; // in types manager, created using context types (if specific type)
|
||||
utils::ClassModifier class_modifier_;
|
||||
TypeManager* type_manager_ = nullptr;
|
||||
};
|
||||
|
||||
|
|
@ -122,7 +130,8 @@ public:
|
|||
bool operator<(const TupleType& type) const;
|
||||
bool operator>(const TupleType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
const std::vector<std::pair<std::optional<std::string>, utils::IdType>>& GetFields() const {
|
||||
return fields_;
|
||||
|
|
@ -147,7 +156,8 @@ public:
|
|||
bool operator<(const VariantType& type) const;
|
||||
bool operator>(const VariantType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
const std::vector<TupleType>& GetConstructors() const {
|
||||
return constructors_;
|
||||
|
|
@ -175,7 +185,8 @@ public:
|
|||
bool operator<(const OptionalType& type) const;
|
||||
bool operator>(const OptionalType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
private:
|
||||
utils::IdType type_;
|
||||
|
|
@ -195,7 +206,8 @@ public:
|
|||
bool operator<(const ReferenceToType& type) const;
|
||||
bool operator>(const ReferenceToType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
private:
|
||||
std::vector<utils::ReferenceModifier> references_;
|
||||
|
|
@ -218,7 +230,8 @@ public:
|
|||
bool operator<(const FunctionType& type) const;
|
||||
bool operator>(const FunctionType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
private:
|
||||
std::vector<utils::IdType> argument_types_;
|
||||
|
|
@ -239,7 +252,8 @@ public:
|
|||
bool operator<(const ArrayType& type) const;
|
||||
bool operator>(const ArrayType& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
utils::IdType GetElementsType() {
|
||||
return elements_type_;
|
||||
|
|
@ -263,7 +277,8 @@ public:
|
|||
bool operator<(const Type& type) const; // TODO: rule exceptions
|
||||
bool operator>(const Type& type) const;
|
||||
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name) const;
|
||||
std::optional<utils::IdType> GetFieldType(const std::string& name,
|
||||
const std::unordered_set<utils::IdType>& type_namespaces) const;
|
||||
|
||||
std::string GetTypeName() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue