optional variable deffinition added, annotations removed

This commit is contained in:
ProgramSnail 2023-06-08 19:22:56 +03:00
parent 7ce8513ad0
commit de7c1e062f
20 changed files with 178 additions and 57 deletions

View file

@ -192,13 +192,15 @@ struct PartitionName {
};
struct NameExpression;
struct OptionalName;
struct TupleName;
struct VariantName;
struct AnnotatedName;
struct Name;
// // ScopedAnyName <-> AnyName
using AnyName = std::variant<
std::unique_ptr<AnnotatedName>,
std::unique_ptr<Name>,
std::unique_ptr<OptionalName>,
std::unique_ptr<TupleName>,
std::unique_ptr<VariantName>>;
@ -599,6 +601,12 @@ struct NameExpression {
std::vector<NameIdentifier> names;
};
struct OptionalName {
BaseNode base;
ScopedAnyName name;
};
struct TupleName {
BaseNode base;
@ -611,11 +619,10 @@ struct VariantName {
std::vector<ScopedAnyName> names;
};
struct AnnotatedName {
struct Name {
BaseNode base;
NameIdentifier name;
std::optional<ScopedAnyType> type;
};
// ----------------- Type, typeclass, etc. -----------------