aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r--xtask/src/codegen/rust.ungram60
1 files changed, 32 insertions, 28 deletions
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index bc1dd6761..1d8bed0b4 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -1,3 +1,34 @@
1Path =
2 (qualifier:Path '::')? segment:PathSegment
3
4PathSegment =
5 'crate' | 'self' | 'super'
6| '::' NameRef
7| NameRef GenericArgList?
8| NameRef ParamList RetType?
9| '<' PathType ('as' PathType)? '>'
10
11GenericArgList =
12 '::'? '<' (GenericArg (',' GenericArg)* ','?)? '>'
13
14GenericArg =
15 TypeArg
16| AssocTypeArg
17| LifetimeArg
18| ConstArg
19
20TypeArg =
21 Type
22
23AssocTypeArg =
24 NameRef (':' TypeBoundList | '=' Type)
25
26LifetimeArg =
27 'lifetime'
28
29ConstArg =
30 Expr
31
1SourceFile = 32SourceFile =
2 'shebang'? 33 'shebang'?
3 Attr* 34 Attr*
@@ -318,7 +349,7 @@ ArgList =
318 '(' args:(Expr (',' Expr)* ','?)? ')' 349 '(' args:(Expr (',' Expr)* ','?)? ')'
319 350
320MethodCallExpr = 351MethodCallExpr =
321 Attr* Expr '.' NameRef TypeArgList? ArgList 352 Attr* Expr '.' NameRef GenericArgList? ArgList
322 353
323FieldExpr = 354FieldExpr =
324 Attr* Expr '.' NameRef 355 Attr* Expr '.' NameRef
@@ -521,33 +552,6 @@ MacroStmts =
521 statements:Stmt* 552 statements:Stmt*
522 Expr? 553 Expr?
523 554
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 = 555Pat =
552 OrPat 556 OrPat
553| ParenPat 557| ParenPat