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