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