From 917c89c103597d09e95bdee273633f79123dd19e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:37:46 +0200 Subject: Finaize item grammar --- xtask/src/codegen/rust.ungram | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'xtask/src/codegen') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index cda0e8fbb..cdd3adf45 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -129,7 +129,13 @@ Trait = AssocItemList AssocItemList = - '{' AssocItem* '}' + '{' Attr* AssocItem* '}' + +AssocItem = + Fn +| TypeAlias +| Const +| MacroCall Impl = Attr* Visibility? @@ -139,6 +145,15 @@ Impl = ) WhereClause? AssocItemList +ExternBlock = + Attr* Abi ExternItemList + +ExternItemList = + '{' Attr* ExternItem* '}' + +ExternItem = + Fn | Static | MacroCall + ParenType = '(' TypeRef ')' @@ -449,12 +464,6 @@ LifetimeArg = ConstArg = Literal | BlockExpr BlockExpr -ExternBlock = - Attr* Abi ExternItemList - -ExternItemList = - '{' extern_items:ExternItem* '}' - MetaItem = Path '=' AttrInput nested_meta_items:MetaItem* @@ -478,15 +487,6 @@ TypeRef = | ImplTraitType | DynTraitType -AssocItem = - Fn -| TypeAlias -| Const -| MacroCall - -ExternItem = - Fn | Static - AttrInput = Literal | TokenTree -- cgit v1.2.3