mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
abstract types typecheck, fixes
This commit is contained in:
parent
9aeba7b0de
commit
c433448952
9 changed files with 143 additions and 94 deletions
|
|
@ -26,6 +26,8 @@ struct TypeUsage {
|
|||
struct Parameter {
|
||||
std::string type;
|
||||
std::vector<interpreter::tokens::ParametrizedTypeclass*> typeclass_nodes;
|
||||
|
||||
interpreter::tokens::AnyAnnotatedType* node = nullptr;
|
||||
};
|
||||
|
||||
struct AbstractType {
|
||||
|
|
@ -82,15 +84,16 @@ struct Typeclass {
|
|||
interpreter::tokens::TypeclassDefinitionStatement* node;
|
||||
|
||||
utils::IdType parent_namespace;
|
||||
|
||||
utils::IdType graph_id_; // TODO: make safe??
|
||||
};
|
||||
|
||||
struct Import {
|
||||
std::string module_name;
|
||||
std::vector<std::string> symbols; // size = 0 => all symbols imported
|
||||
std::vector<std::string> symbols; // size == 0 => all symbols imported
|
||||
};
|
||||
|
||||
struct Namespace {
|
||||
|
||||
std::unordered_map<std::string, utils::IdType> types;
|
||||
std::unordered_map<std::string, utils::IdType> functions;
|
||||
std::unordered_map<std::string, utils::IdType> constructors;
|
||||
|
|
@ -103,7 +106,8 @@ struct Namespace {
|
|||
utils::ClassInternalsModifier modifier = utils::ClassInternalsModifier::Static;
|
||||
std::string type_name;
|
||||
|
||||
std::optional<interpreter::tokens::Namespace*> node;
|
||||
// all nodes have same info
|
||||
std::optional<interpreter::tokens::Namespace*> any_node;
|
||||
};
|
||||
|
||||
} // namespace info::definition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue