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/codegen') 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