conlang: Introduce type-alias/typedef syntax
`type T;` | `type T = U;`
This commit is contained in:
@@ -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*)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user