From c04c06c4bc06852610af9d37673b03a8c041b15c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 15:09:20 +0200 Subject: Finalize WhereClause gramamr --- xtask/src/codegen/rust.ungram | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 32f2808ea..fc665b2b2 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -175,7 +175,13 @@ ConstParam = ('=' default_val:Expr)? LifetimeParam = - Attr* 'lifetime' + Attr* 'lifetime' (':' TypeBoundList?)? + +WhereClause = + 'where' predicates:(WherePred (',' WherePred)* ','?) + +WherePred = + ('for' GenericParamList)? ('lifetime' | Type) ':' TypeBoundList Visibility = 'pub' ('(' @@ -450,12 +456,6 @@ MacroStmts = statements:Stmt* Expr? -WherePred = - ('for' GenericParamList)? ('lifetime' | Type) ':' TypeBoundList - -WhereClause = - 'where' predicates:WherePred* - ExprStmt = Attr* Expr ';' -- cgit v1.2.3 From 4d38b0dce1884dab0da7394ccc979eef0a21076c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 15:18:14 +0200 Subject: Move Stmt Grammar --- xtask/src/codegen/rust.ungram | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index fc665b2b2..8271509cf 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -194,6 +194,17 @@ Visibility = Attr = '#' '!'? '[' Path ('=' Literal | TokenTree)? ']' +Stmt = + LetStmt +| ExprStmt + +LetStmt = + Attr* 'let' Pat (':' Type)? + '=' initializer:Expr ';' + +ExprStmt = + Attr* Expr ';'? + Type = ParenType | TupleType @@ -456,13 +467,6 @@ MacroStmts = statements:Stmt* Expr? -ExprStmt = - Attr* Expr ';' - -LetStmt = - Attr* 'let' Pat (':' Type) - '=' initializer:Expr ';' - Path = (qualifier:Path '::')? segment:PathSegment @@ -490,10 +494,6 @@ LifetimeArg = ConstArg = Literal | BlockExpr BlockExpr -Stmt = - LetStmt -| ExprStmt - Pat = OrPat | ParenPat -- cgit v1.2.3