From c5798c4d75aa807aec47208a49101bdec3affcca Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:28:28 +0200 Subject: Finalize impl Grammar --- xtask/src/ast_src.rs | 2 +- xtask/src/codegen/rust.ungram | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index ea8bf50ed..c7087a14e 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -104,7 +104,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { "STATIC", "CONST", "TRAIT", - "IMPL_DEF", + "IMPL", "TYPE_ALIAS", "MACRO_CALL", "TOKEN_TREE", diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index b30658397..cda0e8fbb 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -9,7 +9,7 @@ Item = | ExternBlock | ExternCrate | Fn -| ImplDef +| Impl | MacroCall | Module | Static @@ -131,9 +131,12 @@ Trait = AssocItemList = '{' AssocItem* '}' -ImplDef = - Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' GenericParamList? '!'? 'for' - WhereClause? +Impl = + Attr* Visibility? + 'default'? 'unsafe'? 'impl' 'const'? GenericParamList? ( + TypeRef + | '!'? TypeRef 'for' TypeRef + ) WhereClause? AssocItemList ParenType = -- cgit v1.2.3