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

@ -29,12 +29,12 @@ struct Parameter {
};
struct AbstractType {
enum { Basic, Abstract } modifier;
utils::AbstractTypeModifier modifier;
Parameter type;
};
struct AliasType {
enum {Alias, Type, Let} modifier;
utils::AliasModifier modifier;
std::vector<std::string> parameters;
TypeUsage value;
interpreter::tokens::AliasDefinitionStatement* node = nullptr;
@ -87,17 +87,17 @@ struct Import {
};
struct Namespace {
enum Modifier { Const, Var };
std::unordered_map<std::string, utils::IdType> types;
std::unordered_map<std::string, utils::IdType> functions;
std::unordered_map<std::string, utils::IdType> constructors;
std::unordered_map<std::string, Namespace> namespaces;
std::unordered_map<std::string, Namespace> variable_namespaces;
std::unordered_map<std::string, Namespace> var_namespaces;
std::unordered_map<std::string, Namespace> const_namespaces;
Namespace* parent_namespace = nullptr;
std::optional<Modifier> modifier; // modifier => variable namespace
std::optional<utils::IsConstModifier> modifier; // modifier => variable namespace
std::string type_name;
};