Split ItemList & AssocItemList

This commit is contained in:
Aleksey Kladov 2020-07-30 11:42:51 +02:00
parent 72ffd851dd
commit 2984da672e
14 changed files with 131 additions and 89 deletions

View file

@ -19,6 +19,13 @@ Item =
| UnionDef
| UseItem
Module =
Attr* Visibility? 'mod' Name
(ItemList | ';')
ItemList =
'{' Item* '}'
FnDef =
Attr* Visibility? Abi? 'const' 'default' 'async' 'unsafe' 'fn' Name TypeParamList?
ParamList RetType?
@ -67,17 +74,10 @@ EnumVariant =
TraitDef =
Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name TypeParamList
(':' TypeBoundList?)? WhereClause
ItemList
AssocItemList
Module =
Attr* Visibility? 'mod' Name
(ItemList | ';')
ItemList =
'{'
AssocItem*
Item*
'}'
AssocItemList =
'{' AssocItem* '}'
ConstDef =
Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef
@ -94,7 +94,7 @@ TypeAliasDef =
ImplDef =
Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' TypeParamList? '!'? 'for'
WhereClause?
ItemList
AssocItemList
ParenType =
'(' TypeRef ')'
@ -467,6 +467,7 @@ AssocItem =
FnDef
| TypeAliasDef
| ConstDef
| MacroCall
ExternItem =
FnDef | StaticDef