aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-31 18:49:26 +0100
committerAleksey Kladov <[email protected]>2020-07-31 18:49:26 +0100
commit572f1c08b6ba43bdd57c5cb99f79a08ecd821c1c (patch)
tree5c4677b6e1d3e73424046283c79ebb0d8b175691 /xtask/src/codegen
parent5cade89d730b025082ff2df70aace259951a9ccf (diff)
Minor gramamr reorder
Diffstat (limited to 'xtask/src/codegen')
-rw-r--r--xtask/src/codegen/rust.ungram124
1 files changed, 63 insertions, 61 deletions
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index 2e3b45011..27bf563b6 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -1,3 +1,9 @@
1Name =
2 'ident'
3
4NameRef =
5 'ident' | 'int_number'
6
1Path = 7Path =
2 (qualifier:Path '::')? segment:PathSegment 8 (qualifier:Path '::')? segment:PathSegment
3 9
@@ -29,6 +35,21 @@ LifetimeArg =
29ConstArg = 35ConstArg =
30 Expr 36 Expr
31 37
38MacroCall =
39 Attr* Path '!' Name? TokenTree ';'?
40
41TokenTree =
42 '(' ')'
43| '{' '}'
44| '[' ']'
45
46MacroItems =
47 Item*
48
49MacroStmts =
50 statements:Stmt*
51 Expr?
52
32SourceFile = 53SourceFile =
33 'shebang'? 54 'shebang'?
34 Attr* 55 Attr*
@@ -475,41 +496,37 @@ TypeBound =
475 'lifetime' 496 'lifetime'
476| '?'? Type 497| '?'? Type
477 498
478OrPat = 499Pat =
479 Pat* 500 BindPat
480 501| BoxPat
481ParenPat = 502| DotDotPat
482 '(' Pat ')' 503| LiteralPat
483 504| MacroPat
484RefPat = 505| OrPat
485 '&' 'mut'? Pat 506| ParenPat
486 507| PathPat
487BoxPat = 508| PlaceholderPat
488 'box' Path 509| RangePat
489 510| RecordPat
490BindPat = 511| RefPat
491 Attr* 'ref'? 'mut'? Name ('@' Pat)? 512| SlicePat
492 513| TuplePat
493PlaceholderPat = 514| TupleStructPat
494 '_'
495 515
496DotDotPat = 516LiteralPat =
497 '..' 517 Literal
498 518
499PathPat = 519PathPat =
500 Path 520 Path
501 521
502SlicePat = 522PlaceholderPat =
503 '[' args:Pat* ']' 523 '_'
504 524
505RangePat = 525RangePat =
506 '..' | '..=' 526 start:Pat op:('..' | '..=') end:Pat
507
508LiteralPat =
509 Literal
510 527
511MacroPat = 528RefPat =
512 MacroCall 529 '&' 'mut'? Pat
513 530
514RecordPat = 531RecordPat =
515 Path RecordFieldPatList 532 Path RecordFieldPatList
@@ -522,46 +539,31 @@ RecordFieldPatList =
522 '}' 539 '}'
523 540
524RecordFieldPat = 541RecordFieldPat =
525 Attr* NameRef ':' Pat 542 Attr* (NameRef ':')? Pat
526 543
527TupleStructPat = 544OrPat =
528 Path '(' args:Pat* ')' 545 Pat*
529 546
530TuplePat = 547ParenPat =
531 '(' args:Pat* ')' 548 '(' Pat ')'
532 549
533Name = 550BoxPat =
534 'ident' 551 'box' Path
535 552
536NameRef = 553BindPat =
537 'ident' | 'int_number' 554 Attr* 'ref'? 'mut'? Name ('@' Pat)?
538 555
539MacroCall = 556DotDotPat =
540 Attr* Path '!' Name? TokenTree ';'? 557 '..'
541 558
542TokenTree = 559SlicePat =
543 '(' ')' | '{' '}' | '[' ']' 560 '[' args:Pat* ']'
544 561
545MacroItems = 562MacroPat =
546 Item* 563 MacroCall
547 564
548MacroStmts = 565TupleStructPat =
549 statements:Stmt* 566 Path '(' args:Pat* ')'
550 Expr?
551 567
552Pat = 568TuplePat =
553 OrPat 569 '(' args:Pat* ')'
554| ParenPat
555| RefPat
556| BoxPat
557| BindPat
558| PlaceholderPat
559| DotDotPat
560| PathPat
561| RecordPat
562| TupleStructPat
563| TuplePat
564| SlicePat
565| RangePat
566| LiteralPat
567| MacroPat