mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
abstract type graph added to symbol table
This commit is contained in:
parent
25355974a2
commit
3c643d2759
8 changed files with 845 additions and 16 deletions
|
|
@ -6,6 +6,9 @@
|
|||
#include <optional>
|
||||
#include <memory>
|
||||
|
||||
// for clangd
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace interpreter::tokens {
|
||||
|
||||
// ----------------- Declarations -----------------
|
||||
|
|
@ -293,6 +296,8 @@ struct AliasDefinitionStatement {
|
|||
TypeIdentifier type;
|
||||
std::vector<AbstractTypeIdentifier> parameters;
|
||||
std::unique_ptr<ParametrizedType> value;
|
||||
|
||||
utils::IdType type_id_;
|
||||
};
|
||||
|
||||
struct VariableDefinitionStatement {
|
||||
|
|
@ -306,28 +311,38 @@ struct FunctionDeclaration {
|
|||
NameOrOperatorIdentifier name;
|
||||
std::vector<std::unique_ptr<AnnotatedAbstractType>> parameters;
|
||||
std::unique_ptr<FunctionType> type;
|
||||
|
||||
utils::IdType function_id_;
|
||||
};
|
||||
|
||||
struct FunctionDefinitionStatement {
|
||||
bool is_inline;
|
||||
std::unique_ptr<FunctionDefinition> definition;
|
||||
SuperExpression value;
|
||||
|
||||
utils::IdType function_id_;
|
||||
};
|
||||
|
||||
struct TypeDefinitionStatement {
|
||||
enum { Struct, Class } modifier;
|
||||
std::unique_ptr<TypeDefinition> definition;
|
||||
AnyType value;
|
||||
|
||||
utils::IdType type_id_;
|
||||
};
|
||||
|
||||
struct AbstractTypeDefinitionStatement {
|
||||
enum { Basic, Abstract } modifier;
|
||||
std::unique_ptr<AnnotatedType> type;
|
||||
|
||||
utils::IdType type_id_;
|
||||
};
|
||||
|
||||
struct TypeclassDefinitionStatement {
|
||||
std::unique_ptr<TypeDefinition> definition;
|
||||
std::vector<std::unique_ptr<FunctionDeclaration>> requirements;
|
||||
|
||||
utils::IdType typeclass_id_;
|
||||
};
|
||||
|
||||
// Definition parts -----------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue