fixes , modifier enum refacing, type visitor part

This commit is contained in:
ProgramSnail 2023-05-05 16:35:13 +03:00
parent b686fe00fb
commit c4045e292b
9 changed files with 147 additions and 132 deletions

View file

@ -19,8 +19,9 @@ class TypeManager;
class AbstractType { // later will be found in context
public:
AbstractType() = default;
AbstractType(const std::string& name,
const std::vector<utils::IdType>& requirements) : name_(name) {
AbstractType(utils::AbstractTypeModifier modifier,
const std::string& name,
const std::vector<utils::IdType>& requirements) : modifier_(modifier), name_(name) {
for (auto& typeclass : requirements) {
requirements_.insert(typeclass);
}
@ -31,6 +32,7 @@ public:
bool operator<(const AbstractType& type) const;
bool operator>(const AbstractType& type) const;
private:
utils::AbstractTypeModifier modifier_;
std::string name_;
std::unordered_set<utils::IdType> requirements_; // TODO: all typeclasses from tree
};
@ -135,7 +137,7 @@ private:
class ReferenceToType {
public:
ReferenceToType() = default;
ReferenceToType(const std::vector<utils::ReferenceType>& references,
ReferenceToType(const std::vector<utils::ReferenceModifier>& references,
utils::IdType type,
TypeManager* type_manager)
: references_(references), type_(type), type_manager_(type_manager) {}
@ -146,7 +148,7 @@ public:
bool operator>(const ReferenceToType& type) const;
private:
std::vector<utils::ReferenceType> references_;
std::vector<utils::ReferenceModifier> references_;
utils::IdType type_;
TypeManager* type_manager_ = nullptr;
};