mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
fixes , modifier enum refacing, type visitor part
This commit is contained in:
parent
b686fe00fb
commit
c4045e292b
9 changed files with 147 additions and 132 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue