From 2984da672e0c73d56501c6b6e4d19fd28152b5eb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 11:42:51 +0200 Subject: Split ItemList & AssocItemList --- xtask/src/codegen/rust.ungram | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'xtask/src/codegen') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index a93cb3815..d0518cead 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -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 -- cgit v1.2.3