aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/codegen/rust.ungram57
1 files changed, 30 insertions, 27 deletions
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index bc1dd6761..13ad67ca1 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -1,3 +1,33 @@
1Path =
2 (qualifier:Path '::')? segment:PathSegment
3
4PathSegment =
5 '::' | 'crate' | 'self' | 'super'
6| (NameRef ('::'? TypeArgList)?)
7| NameRef ParamList RetType?
8| '<' PathType ('as' PathType)? '>'
9
10TypeArgList =
11 '::'? '<'
12 TypeArg*
13 LifetimeArg*
14 AssocTypeArg*
15 ConstArg*
16 '>'
17
18TypeArg =
19 Type
20
21AssocTypeArg =
22 NameRef (':' TypeBoundList | '=' Type)
23
24LifetimeArg =
25 'lifetime'
26
27ConstArg =
28 Literal | BlockExpr BlockExpr
29
30
1SourceFile = 31SourceFile =
2 'shebang'? 32 'shebang'?
3 Attr* 33 Attr*
@@ -521,33 +551,6 @@ MacroStmts =
521 statements:Stmt* 551 statements:Stmt*
522 Expr? 552 Expr?
523 553
524Path =
525 (qualifier:Path '::')? segment:PathSegment
526
527PathSegment =
528 '::' | 'crate' | 'self' | 'super'
529| '<' NameRef TypeArgList ParamList RetType PathType '>'
530
531TypeArgList =
532 '::'? '<'
533 TypeArg*
534 LifetimeArg*
535 AssocTypeArg*
536 ConstArg*
537 '>'
538
539TypeArg =
540 Type
541
542AssocTypeArg =
543 NameRef (':' TypeBoundList | '=' Type)
544
545LifetimeArg =
546 'lifetime'
547
548ConstArg =
549 Literal | BlockExpr BlockExpr
550
551Pat = 554Pat =
552 OrPat 555 OrPat
553| ParenPat 556| ParenPat