mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
part of type_check_visitor
This commit is contained in:
parent
94ef8702fb
commit
f7e985a448
10 changed files with 377 additions and 88 deletions
|
|
@ -17,6 +17,8 @@ namespace interpreter {
|
|||
|
||||
namespace info::definition {
|
||||
|
||||
struct Namespace;
|
||||
|
||||
struct TypeUsage {
|
||||
interpreter::tokens::TypeExpression* node;
|
||||
};
|
||||
|
|
@ -42,6 +44,8 @@ struct AnyType {
|
|||
Parameter type;
|
||||
std::vector<Parameter> parameters;
|
||||
interpreter::tokens::AnyType* value;
|
||||
|
||||
Namespace* parent_namespace = nullptr;
|
||||
};
|
||||
|
||||
struct Type {
|
||||
|
|
@ -52,6 +56,7 @@ struct Constructor {
|
|||
std::string name;
|
||||
size_t order;
|
||||
utils::IdType type_id;
|
||||
std::optional<interpreter::tokens::TupleType*> constructor_tuple_node;
|
||||
};
|
||||
|
||||
struct FunctionDeclaration {
|
||||
|
|
@ -90,7 +95,7 @@ struct Namespace {
|
|||
std::unordered_map<std::string, Namespace> namespaces;
|
||||
std::unordered_map<std::string, Namespace> variable_namespaces;
|
||||
|
||||
Namespace* parent_namespace = nullptr;;
|
||||
Namespace* parent_namespace = nullptr;
|
||||
|
||||
std::optional<Modifier> modifier; // modifier => variable namespace
|
||||
std::string type_name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue