From 675e86becfab2615528152487db49bce1b43bd60 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 21:56:52 +0200 Subject: Section headers --- xtask/src/codegen/rust.ungram | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 02f5aa732..b14801f24 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -1,3 +1,7 @@ +//*************************// +// Names, Paths and Macros // +//*************************// + Name = 'ident' @@ -50,6 +54,10 @@ MacroStmts = statements:Stmt* Expr? +//*************************// +// Items // +//*************************// + SourceFile = 'shebang'? Attr* @@ -245,6 +253,10 @@ Visibility = Attr = '#' '!'? '[' Path ('=' Literal | TokenTree)? ']' +//****************************// +// Statements and Expressions // +//****************************// + Stmt = ExprStmt | Item @@ -434,6 +446,10 @@ AwaitExpr = BoxExpr = Attr* 'box' Expr +//*************************// +// Types // +//*************************// + Type = ArrayType | DynTraitType @@ -495,6 +511,10 @@ TypeBound = 'lifetime' | '?'? Type +//************************// +// Patterns // +//************************// + Pat = IdentPat | BoxPat -- cgit v1.2.3 From b9c6aa9ec9e491160a6ad7c5ec66151bd67b0ecd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 21:58:36 +0200 Subject: Unify naming of tuple fields --- xtask/src/codegen/rust.ungram | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index b14801f24..aca23890c 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -359,7 +359,7 @@ IndexExpr = Attr* base:Expr '[' index:Expr ']' TupleExpr = - Attr* '(' Attr* (Expr (',' Expr)* ','?)? ')' + Attr* '(' Attr* fields:(Expr (',' Expr)* ','?)? ')' RecordExpr = Path RecordExprFieldList @@ -560,16 +560,16 @@ RecordPatField = Attr* (NameRef ':')? Pat TupleStructPat = - Path '(' args:(Pat (',' Pat)* ','?)? ')' + Path '(' fields:(Pat (',' Pat)* ','?)? ')' TuplePat = - '(' args:(Pat (',' Pat)* ','?)? ')' + '(' fields:(Pat (',' Pat)* ','?)? ')' ParenPat = '(' Pat ')' SlicePat = - '[' args:(Pat (',' Pat)* ','?)? ']' + '[' (Pat (',' Pat)* ','?)? ']' PathPat = Path -- cgit v1.2.3