conlang: Introduce type-alias/typedef syntax

`type T;` | `type T = U;`
This commit is contained in:
2024-02-27 20:49:02 -06:00
parent 0c1b3bfe39
commit 978f5e40c1
6 changed files with 52 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ File = Item* EOI ;
Item = Visibility ItemKind ;
ItemKind = Const | Static | Module
| Function | Struct | Enum
| Impl ;
| Alias | Impl ;
(* item *)
@@ -36,6 +36,8 @@ VarStruct = '{' (StructMember ',')* StructMember? '}' ;
VarTuple = TyTuple ;
VarCLike = '=' INTEGER ;
Alias = "type" Ty ('=' Ty)? ';' ;
Impl = "impl" Path '{' Item* '}' ;
(* TODO: Impl Trait for Target*)