This commit is contained in:
Aleksey Kladov 2020-07-31 12:02:42 +02:00
parent 6b7cb8b5ab
commit e0f21133cd

View file

@ -114,6 +114,11 @@ Union =
Attr* Visibility? 'union' Name GenericParamList? WhereClause? Attr* Visibility? 'union' Name GenericParamList? WhereClause?
RecordFieldList RecordFieldList
AdtDef =
Struct
| Enum
| Union
Const = Const =
Attr* Visibility? 'default'? 'const' (Name | '_') ':' ty:TypeRef Attr* Visibility? 'default'? 'const' (Name | '_') ':' ty:TypeRef
'=' body:Expr ';' '=' body:Expr ';'
@ -183,6 +188,21 @@ Visibility =
Attr = Attr =
'#' '!'? '[' Path ('=' Literal | TokenTree)? ']' '#' '!'? '[' Path ('=' Literal | TokenTree)? ']'
TypeRef =
ParenType
| TupleType
| NeverType
| PathType
| PointerType
| ArrayType
| SliceType
| ReferenceType
| PlaceholderType
| FnPointerType
| ForType
| ImplTraitType
| DynTraitType
ParenType = ParenType =
'(' ty:TypeRef ')' '(' ty:TypeRef ')'
@ -469,26 +489,6 @@ LifetimeArg =
ConstArg = ConstArg =
Literal | BlockExpr BlockExpr Literal | BlockExpr BlockExpr
AdtDef =
Struct
| Enum
| Union
TypeRef =
ParenType
| TupleType
| NeverType
| PathType
| PointerType
| ArrayType
| SliceType
| ReferenceType
| PlaceholderType
| FnPointerType
| ForType
| ImplTraitType
| DynTraitType
Stmt = Stmt =
LetStmt LetStmt
| ExprStmt | ExprStmt