mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-06 06:58:45 +00:00
changes for new grammar, fixes
This commit is contained in:
parent
91f9affadc
commit
3106a64949
35 changed files with 605 additions and 550 deletions
|
|
@ -212,13 +212,14 @@ struct FunctionType;
|
|||
struct TupleType;
|
||||
struct VariantType;
|
||||
struct TypeExpression;
|
||||
struct TypeExpression;
|
||||
|
||||
using WrappedTypeExpression = TypeExpression;
|
||||
|
||||
using Constructor = std::string;
|
||||
|
||||
// // ScopedAnyType <-> AnyType
|
||||
using AnyType = std::variant<
|
||||
std::unique_ptr<TypeExpression>,
|
||||
std::unique_ptr<WrappedTypeExpression>,
|
||||
std::unique_ptr<TupleType>,
|
||||
std::unique_ptr<VariantType>,
|
||||
std::unique_ptr<FunctionType>>;
|
||||
|
|
@ -272,6 +273,8 @@ struct Namespace {
|
|||
TypeIdentifier type;
|
||||
NamespaceSources scope;
|
||||
|
||||
bool is_type_namespace = false; // TODO: use
|
||||
|
||||
std::optional<utils::IdType> link_type_id_;
|
||||
std::optional<utils::IdType> link_typeclass_id_;
|
||||
};
|
||||
|
|
@ -292,7 +295,7 @@ struct AliasDefinitionStatement {
|
|||
utils::AliasModifier modifier;
|
||||
TypeIdentifier type;
|
||||
std::vector<AbstractTypeIdentifier> parameters;
|
||||
std::unique_ptr<TypeExpression> value;
|
||||
std::unique_ptr<WrappedTypeExpression> value;
|
||||
|
||||
utils::IdType type_id_ = 0;
|
||||
};
|
||||
|
|
@ -516,7 +519,7 @@ struct FunctionCallExpression {
|
|||
BaseNode base;
|
||||
|
||||
std::optional<std::variant<std::unique_ptr<SubExpressionToken>,
|
||||
std::unique_ptr<TypeExpression>>> prefix;
|
||||
std::unique_ptr<WrappedTypeExpression>>> prefix;
|
||||
NameOrOperatorIdentifier name;
|
||||
std::vector<std::unique_ptr<TypeExpression>> parameters;
|
||||
std::vector<SubExpression> arguments;
|
||||
|
|
@ -621,21 +624,21 @@ struct AnnotatedName {
|
|||
struct FunctionType {
|
||||
BaseNode base;
|
||||
|
||||
std::vector<ScopedAnyType> types;
|
||||
std::vector<std::unique_ptr<ExtendedScopedAnyType>> types;
|
||||
};
|
||||
|
||||
struct TupleType {
|
||||
BaseNode base;
|
||||
|
||||
std::optional<Constructor> type;
|
||||
std::optional<TypeIdentifier> type;
|
||||
std::vector<std::pair<std::optional<NameIdentifier>, std::unique_ptr<ExtendedScopedAnyType>>> entities;
|
||||
};
|
||||
|
||||
struct VariantType {
|
||||
BaseNode base;
|
||||
|
||||
std::optional<Constructor> type;
|
||||
std::vector<std::variant<Constructor, std::unique_ptr<TupleType>>> constructors;
|
||||
std::optional<TypeIdentifier> type;
|
||||
std::vector<std::pair<std::optional<Constructor>, std::optional<std::unique_ptr<TupleType>>>> constructors;
|
||||
};
|
||||
|
||||
struct ParametrizedType {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue