From b2cdb0b22631a66a00be25ba4b2e9c0b34ff426a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:15:08 +0200 Subject: Fix param gramamr --- xtask/src/codegen/rust.ungram | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xtask/src/codegen/rust.ungram') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index ef7c3e50e..4f7f6403e 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -66,8 +66,11 @@ SelfParam = ) Param = - Attr* Pat (':' ascribed_type:TypeRef) -| '...' + Attr* ( + Pat (':' ascribed_type:TypeRef) + | ascribed_type:TypeRef + | '...' + ) RetType = '->' TypeRef -- cgit v1.2.3 From c83467796b6c7365ea4f41900d74444384a9e618 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:17:28 +0200 Subject: Finalize Trait grammar --- xtask/src/codegen/rust.ungram | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xtask/src/codegen/rust.ungram') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 4f7f6403e..b30658397 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -14,7 +14,7 @@ Item = | Module | Static | Struct -| TraitDef +| Trait | TypeAlias | Union | Use @@ -123,7 +123,7 @@ Static = Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef '=' body:Expr ';' -TraitDef = +Trait = Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name GenericParamList (':' TypeBoundList?)? WhereClause AssocItemList -- cgit v1.2.3 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/codegen/rust.ungram | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xtask/src/codegen/rust.ungram') 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