aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/codegen/rust.ungram28
1 files changed, 24 insertions, 4 deletions
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index 02f5aa732..aca23890c 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -1,3 +1,7 @@
1//*************************//
2// Names, Paths and Macros //
3//*************************//
4
1Name = 5Name =
2 'ident' 6 'ident'
3 7
@@ -50,6 +54,10 @@ MacroStmts =
50 statements:Stmt* 54 statements:Stmt*
51 Expr? 55 Expr?
52 56
57//*************************//
58// Items //
59//*************************//
60
53SourceFile = 61SourceFile =
54 'shebang'? 62 'shebang'?
55 Attr* 63 Attr*
@@ -245,6 +253,10 @@ Visibility =
245Attr = 253Attr =
246 '#' '!'? '[' Path ('=' Literal | TokenTree)? ']' 254 '#' '!'? '[' Path ('=' Literal | TokenTree)? ']'
247 255
256//****************************//
257// Statements and Expressions //
258//****************************//
259
248Stmt = 260Stmt =
249 ExprStmt 261 ExprStmt
250| Item 262| Item
@@ -347,7 +359,7 @@ IndexExpr =
347 Attr* base:Expr '[' index:Expr ']' 359 Attr* base:Expr '[' index:Expr ']'
348 360
349TupleExpr = 361TupleExpr =
350 Attr* '(' Attr* (Expr (',' Expr)* ','?)? ')' 362 Attr* '(' Attr* fields:(Expr (',' Expr)* ','?)? ')'
351 363
352RecordExpr = 364RecordExpr =
353 Path RecordExprFieldList 365 Path RecordExprFieldList
@@ -434,6 +446,10 @@ AwaitExpr =
434BoxExpr = 446BoxExpr =
435 Attr* 'box' Expr 447 Attr* 'box' Expr
436 448
449//*************************//
450// Types //
451//*************************//
452
437Type = 453Type =
438 ArrayType 454 ArrayType
439| DynTraitType 455| DynTraitType
@@ -495,6 +511,10 @@ TypeBound =
495 'lifetime' 511 'lifetime'
496| '?'? Type 512| '?'? Type
497 513
514//************************//
515// Patterns //
516//************************//
517
498Pat = 518Pat =
499 IdentPat 519 IdentPat
500| BoxPat 520| BoxPat
@@ -540,16 +560,16 @@ RecordPatField =
540 Attr* (NameRef ':')? Pat 560 Attr* (NameRef ':')? Pat
541 561
542TupleStructPat = 562TupleStructPat =
543 Path '(' args:(Pat (',' Pat)* ','?)? ')' 563 Path '(' fields:(Pat (',' Pat)* ','?)? ')'
544 564
545TuplePat = 565TuplePat =
546 '(' args:(Pat (',' Pat)* ','?)? ')' 566 '(' fields:(Pat (',' Pat)* ','?)? ')'
547 567
548ParenPat = 568ParenPat =
549 '(' Pat ')' 569 '(' Pat ')'
550 570
551SlicePat = 571SlicePat =
552 '[' args:(Pat (',' Pat)* ','?)? ']' 572 '[' (Pat (',' Pat)* ','?)? ']'
553 573
554PathPat = 574PathPat =
555 Path 575 Path