From ceca94536c7346287e533cd93467c7dc5bf1ed52 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:55:49 +0200 Subject: Finalize visibility grammar --- xtask/src/codegen/rust.ungram | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 4025f7f96..b773eaf8b 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -173,6 +173,14 @@ ConstParam = LifetimeParam = Attr* 'lifetime' +Visibility = + 'pub' ('(' + 'super' + | 'self' + | 'crate' + | 'in' Path + ')')? + ParenType = '(' TypeRef ')' @@ -391,9 +399,6 @@ TupleStructPat = TuplePat = '(' args:Pat* ')' -Visibility = - 'pub' ('(' 'super' | 'self' | 'crate' | 'in' Path ')')? - Name = 'ident' -- cgit v1.2.3 From 71a4d325620ede42e8e6fad55ab95430eb47e1fd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 19:10:22 +0200 Subject: Minor --- xtask/src/codegen/rust.ungram | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index b773eaf8b..74fe65633 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -181,6 +181,12 @@ Visibility = | 'in' Path ')')? +Attr = + '#' '!'? '[' Path ('=' input:AttrInput)? ']' + +AttrInput = + Literal | TokenTree + ParenType = '(' TypeRef ')' @@ -421,9 +427,6 @@ MacroStmts = statements:Stmt* Expr? -Attr = - '#' '!'? '[' Path ('=' input:AttrInput)? ']' - TypeBound = 'lifetime' | 'const'? TypeRef @@ -493,10 +496,6 @@ TypeRef = | ImplTraitType | DynTraitType -AttrInput = - Literal -| TokenTree - Stmt = LetStmt | ExprStmt -- cgit v1.2.3 From 01d6c3836b1c540b14d9c9e17974df64afa978c0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 19:10:46 +0200 Subject: Dead code --- xtask/src/codegen/rust.ungram | 3 --- 1 file changed, 3 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 74fe65633..a97cc80e9 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -473,9 +473,6 @@ LifetimeArg = ConstArg = Literal | BlockExpr BlockExpr -MetaItem = - Path '=' AttrInput nested_meta_items:MetaItem* - AdtDef = Struct | Enum -- cgit v1.2.3