mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-17 04:18:43 +00:00
optional variable deffinition added, annotations removed
This commit is contained in:
parent
7ce8513ad0
commit
de7c1e062f
20 changed files with 178 additions and 57 deletions
|
|
@ -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. -----------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue