aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar.ron
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-08-19 10:37:03 +0100
committerGitHub <[email protected]>2019-08-19 10:37:03 +0100
commit53241928e5866b5aa501710e59b264905beeca1a (patch)
tree2e1533cdefd25cda25f02711632ae8e206cc68f6 /crates/ra_syntax/src/grammar.ron
parent83413cc9ef73d578f2e42c21f7aa85ef296be8c0 (diff)
parent038975b348b03dd3063d14cabd30fa71b010baea (diff)
Merge #1697
1697: Use quote instead of tera for boilerplate generation r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar.ron')
-rw-r--r--crates/ra_syntax/src/grammar.ron160
1 files changed, 80 insertions, 80 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index f2c20573e..26efeeba9 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -2,61 +2,61 @@
2// See `cargo gen-syntax` (defined in crates/tools/src/main.rs) 2// See `cargo gen-syntax` (defined in crates/tools/src/main.rs)
3Grammar( 3Grammar(
4 single_byte_tokens: [ 4 single_byte_tokens: [
5 [";", "SEMI"], 5 (";", "SEMI"),
6 [",", "COMMA"], 6 (",", "COMMA"),
7 ["(", "L_PAREN"], 7 ("(", "L_PAREN"),
8 [")", "R_PAREN"], 8 (")", "R_PAREN"),
9 ["{", "L_CURLY"], 9 ("{", "L_CURLY"),
10 ["}", "R_CURLY"], 10 ("}", "R_CURLY"),
11 ["[", "L_BRACK"], 11 ("[", "L_BRACK"),
12 ["]", "R_BRACK"], 12 ("]", "R_BRACK"),
13 ["<", "L_ANGLE"], 13 ("<", "L_ANGLE"),
14 [">", "R_ANGLE"], 14 (">", "R_ANGLE"),
15 ["@", "AT"], 15 ("@", "AT"),
16 ["#", "POUND"], 16 ("#", "POUND"),
17 ["~", "TILDE"], 17 ("~", "TILDE"),
18 ["?", "QUESTION"], 18 ("?", "QUESTION"),
19 ["$", "DOLLAR"], 19 ("$", "DOLLAR"),
20 ["&", "AMP"], 20 ("&", "AMP"),
21 ["|", "PIPE"], 21 ("|", "PIPE"),
22 ["+", "PLUS"], 22 ("+", "PLUS"),
23 ["*", "STAR"], 23 ("*", "STAR"),
24 ["/", "SLASH"], 24 ("/", "SLASH"),
25 ["^", "CARET"], 25 ("^", "CARET"),
26 ["%", "PERCENT"], 26 ("%", "PERCENT"),
27 ["_", "UNDERSCORE"], 27 ("_", "UNDERSCORE"),
28 ], 28 ],
29 // Tokens for which the longest match must be chosen (e.g. `..` is a DOTDOT, but `.` is a DOT) 29 // Tokens for which the longest match must be chosen (e.g. `..` is a DOTDOT, but `.` is a DOT)
30 multi_byte_tokens: [ 30 multi_byte_tokens: [
31 [".", "DOT"], 31 (".", "DOT"),
32 ["..", "DOTDOT"], 32 ("..", "DOTDOT"),
33 ["...", "DOTDOTDOT"], 33 ("...", "DOTDOTDOT"),
34 ["..=", "DOTDOTEQ"], 34 ("..=", "DOTDOTEQ"),
35 [":", "COLON"], 35 (":", "COLON"),
36 ["::", "COLONCOLON"], 36 ("::", "COLONCOLON"),
37 ["=", "EQ"], 37 ("=", "EQ"),
38 ["==", "EQEQ"], 38 ("==", "EQEQ"),
39 ["=>", "FAT_ARROW"], 39 ("=>", "FAT_ARROW"),
40 ["!", "EXCL"], 40 ("!", "EXCL"),
41 ["!=", "NEQ"], 41 ("!=", "NEQ"),
42 ["-", "MINUS"], 42 ("-", "MINUS"),
43 ["->", "THIN_ARROW"], 43 ("->", "THIN_ARROW"),
44 ["<=", "LTEQ"], 44 ("<=", "LTEQ"),
45 [">=", "GTEQ"], 45 (">=", "GTEQ"),
46 ["+=", "PLUSEQ"], 46 ("+=", "PLUSEQ"),
47 ["-=", "MINUSEQ"], 47 ("-=", "MINUSEQ"),
48 ["|=", "PIPEEQ"], 48 ("|=", "PIPEEQ"),
49 ["&=", "AMPEQ"], 49 ("&=", "AMPEQ"),
50 ["^=", "CARETEQ"], 50 ("^=", "CARETEQ"),
51 ["/=", "SLASHEQ"], 51 ("/=", "SLASHEQ"),
52 ["*=", "STAREQ"], 52 ("*=", "STAREQ"),
53 ["%=", "PERCENTEQ"], 53 ("%=", "PERCENTEQ"),
54 ["&&", "AMPAMP"], 54 ("&&", "AMPAMP"),
55 ["||", "PIPEPIPE"], 55 ("||", "PIPEPIPE"),
56 ["<<", "SHL"], 56 ("<<", "SHL"),
57 [">>", "SHR"], 57 (">>", "SHR"),
58 ["<<=", "SHLEQ"], 58 ("<<=", "SHLEQ"),
59 [">>=", "SHREQ"], 59 (">>=", "SHREQ"),
60 ], 60 ],
61 keywords: [ 61 keywords: [
62 "async", 62 "async",
@@ -263,7 +263,7 @@ Grammar(
263 "SourceFile": ( 263 "SourceFile": (
264 traits: [ "ModuleItemOwner", "FnDefOwner" ], 264 traits: [ "ModuleItemOwner", "FnDefOwner" ],
265 collections: [ 265 collections: [
266 ["modules", "Module"], 266 ("modules", "Module"),
267 ] 267 ]
268 ), 268 ),
269 "FnDef": ( 269 "FnDef": (
@@ -286,7 +286,7 @@ Grammar(
286 "DocCommentsOwner" 286 "DocCommentsOwner"
287 ] 287 ]
288 ), 288 ),
289 "NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]), 289 "NamedFieldDefList": (collections: [("fields", "NamedFieldDef")]),
290 "NamedFieldDef": ( 290 "NamedFieldDef": (
291 traits: [ 291 traits: [
292 "VisibilityOwner", 292 "VisibilityOwner",
@@ -296,7 +296,7 @@ Grammar(
296 "TypeAscriptionOwner" 296 "TypeAscriptionOwner"
297 ] 297 ]
298 ), 298 ),
299 "PosFieldDefList": (collections: [["fields", "PosFieldDef"]]), 299 "PosFieldDefList": (collections: [("fields", "PosFieldDef")]),
300 "PosFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]), 300 "PosFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]),
301 "EnumDef": ( traits: [ 301 "EnumDef": ( traits: [
302 "VisibilityOwner", 302 "VisibilityOwner",
@@ -305,7 +305,7 @@ Grammar(
305 "AttrsOwner", 305 "AttrsOwner",
306 "DocCommentsOwner" 306 "DocCommentsOwner"
307 ], options: [["variant_list", "EnumVariantList"]] ), 307 ], options: [["variant_list", "EnumVariantList"]] ),
308 "EnumVariantList": ( collections: [["variants", "EnumVariant"]] ), 308 "EnumVariantList": ( collections: [("variants", "EnumVariant")] ),
309 "EnumVariant": ( traits: ["NameOwner", "DocCommentsOwner", "AttrsOwner"], options: ["Expr"] ), 309 "EnumVariant": ( traits: ["NameOwner", "DocCommentsOwner", "AttrsOwner"], options: ["Expr"] ),
310 "TraitDef": ( 310 "TraitDef": (
311 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeParamsOwner", "TypeBoundsOwner"], 311 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeParamsOwner", "TypeBoundsOwner"],
@@ -316,7 +316,7 @@ Grammar(
316 options: [ "ItemList" ] 316 options: [ "ItemList" ]
317 ), 317 ),
318 "ItemList": ( 318 "ItemList": (
319 collections: [["impl_items", "ImplItem"]], 319 collections: [("impl_items", "ImplItem")],
320 traits: [ "FnDefOwner", "ModuleItemOwner" ], 320 traits: [ "FnDefOwner", "ModuleItemOwner" ],
321 ), 321 ),
322 "ConstDef": ( 322 "ConstDef": (
@@ -355,7 +355,7 @@ Grammar(
355 "ImplBlock": (options: ["ItemList"], traits: ["TypeParamsOwner", "AttrsOwner"]), 355 "ImplBlock": (options: ["ItemList"], traits: ["TypeParamsOwner", "AttrsOwner"]),
356 356
357 "ParenType": (options: ["TypeRef"]), 357 "ParenType": (options: ["TypeRef"]),
358 "TupleType": ( collections: [["fields", "TypeRef"]] ), 358 "TupleType": ( collections: [("fields", "TypeRef")] ),
359 "NeverType": (), 359 "NeverType": (),
360 "PathType": (options: ["Path"]), 360 "PathType": (options: ["Path"]),
361 "PointerType": (options: ["TypeRef"]), 361 "PointerType": (options: ["TypeRef"]),
@@ -405,10 +405,10 @@ Grammar(
405 ), 405 ),
406 406
407 "TupleExpr": ( 407 "TupleExpr": (
408 collections: [["exprs", "Expr"]] 408 collections: [("exprs", "Expr")]
409 ), 409 ),
410 "ArrayExpr": ( 410 "ArrayExpr": (
411 collections: [["exprs", "Expr"]] 411 collections: [("exprs", "Expr")]
412 ), 412 ),
413 "ParenExpr": (options: ["Expr"]), 413 "ParenExpr": (options: ["Expr"]),
414 "PathExpr": (options: ["Path"]), 414 "PathExpr": (options: ["Path"]),
@@ -449,7 +449,7 @@ Grammar(
449 options: [ "Expr", "MatchArmList" ], 449 options: [ "Expr", "MatchArmList" ],
450 ), 450 ),
451 "MatchArmList": ( 451 "MatchArmList": (
452 collections: [ ["arms", "MatchArm"] ], 452 collections: [ ("arms", "MatchArm") ],
453 traits: [ "AttrsOwner" ] 453 traits: [ "AttrsOwner" ]
454 ), 454 ),
455 "MatchArm": ( 455 "MatchArm": (
@@ -457,13 +457,13 @@ Grammar(
457 [ "guard", "MatchGuard" ], 457 [ "guard", "MatchGuard" ],
458 "Expr", 458 "Expr",
459 ], 459 ],
460 collections: [ [ "pats", "Pat" ] ], 460 collections: [ ("pats", "Pat") ],
461 traits: [ "AttrsOwner" ] 461 traits: [ "AttrsOwner" ]
462 ), 462 ),
463 "MatchGuard": (options: ["Expr"]), 463 "MatchGuard": (options: ["Expr"]),
464 "StructLit": (options: ["Path", "NamedFieldList"]), 464 "StructLit": (options: ["Path", "NamedFieldList"]),
465 "NamedFieldList": ( 465 "NamedFieldList": (
466 collections: [ ["fields", "NamedField"] ], 466 collections: [ ("fields", "NamedField") ],
467 options: [["spread", "Expr"]] 467 options: [["spread", "Expr"]]
468 ), 468 ),
469 "NamedField": (options: ["NameRef", "Expr"]), 469 "NamedField": (options: ["NameRef", "Expr"]),
@@ -532,8 +532,8 @@ Grammar(
532 "StructPat": ( options: ["FieldPatList", "Path"] ), 532 "StructPat": ( options: ["FieldPatList", "Path"] ),
533 "FieldPatList": ( 533 "FieldPatList": (
534 collections: [ 534 collections: [
535 ["field_pats", "FieldPat"], 535 ("field_pats", "FieldPat"),
536 ["bind_pats", "BindPat"], 536 ("bind_pats", "BindPat"),
537 ] 537 ]
538 ), 538 ),
539 "FieldPat": ( 539 "FieldPat": (
@@ -542,9 +542,9 @@ Grammar(
542 ), 542 ),
543 "TupleStructPat": ( 543 "TupleStructPat": (
544 options: ["Path"], 544 options: ["Path"],
545 collections: [["args", "Pat"]], 545 collections: [("args", "Pat")],
546 ), 546 ),
547 "TuplePat": ( collections: [["args", "Pat"]] ), 547 "TuplePat": ( collections: [("args", "Pat")] ),
548 "SlicePat": (), 548 "SlicePat": (),
549 "RangePat": (), 549 "RangePat": (),
550 "LiteralPat": (options: ["Literal"]), 550 "LiteralPat": (options: ["Literal"]),
@@ -575,8 +575,8 @@ Grammar(
575 "TokenTree": (), 575 "TokenTree": (),
576 "TypeParamList": ( 576 "TypeParamList": (
577 collections: [ 577 collections: [
578 ["type_params", "TypeParam" ], 578 ("type_params", "TypeParam" ),
579 ["lifetime_params", "LifetimeParam" ], 579 ("lifetime_params", "LifetimeParam" ),
580 ] 580 ]
581 ), 581 ),
582 "TypeParam": ( traits: ["NameOwner", "AttrsOwner", "TypeBoundsOwner", "DefaultTypeParamOwner"] ), 582 "TypeParam": ( traits: ["NameOwner", "AttrsOwner", "TypeBoundsOwner", "DefaultTypeParamOwner"] ),
@@ -590,7 +590,7 @@ Grammar(
590 ), 590 ),
591 "TypeBoundList": ( 591 "TypeBoundList": (
592 collections: [ 592 collections: [
593 ["bounds", "TypeBound"], 593 ("bounds", "TypeBound"),
594 ] 594 ]
595 ), 595 ),
596 "WherePred": ( 596 "WherePred": (
@@ -603,7 +603,7 @@ Grammar(
603 ), 603 ),
604 "WhereClause": ( 604 "WhereClause": (
605 collections: [ 605 collections: [
606 ["predicates", "WherePred"], 606 ("predicates", "WherePred"),
607 ], 607 ],
608 ), 608 ),
609 "ExprStmt": ( 609 "ExprStmt": (
@@ -627,7 +627,7 @@ Grammar(
627 "Block": ( 627 "Block": (
628 options: [ "Expr" ], 628 options: [ "Expr" ],
629 collections: [ 629 collections: [
630 ["statements", "Stmt"], 630 ("statements", "Stmt"),
631 ], 631 ],
632 traits: [ 632 traits: [
633 "AttrsOwner", 633 "AttrsOwner",
@@ -636,7 +636,7 @@ Grammar(
636 "ParamList": ( 636 "ParamList": (
637 options: [ "SelfParam" ], 637 options: [ "SelfParam" ],
638 collections: [ 638 collections: [
639 ["params", "Param"] 639 ("params", "Param"),
640 ] 640 ]
641 ), 641 ),
642 "SelfParam": ( 642 "SelfParam": (
@@ -663,14 +663,14 @@ Grammar(
663 traits: ["NameOwner"], 663 traits: ["NameOwner"],
664 ), 664 ),
665 "UseTreeList": ( 665 "UseTreeList": (
666 collections: [["use_trees", "UseTree"]] 666 collections: [("use_trees", "UseTree")]
667 ), 667 ),
668 "ExternCrateItem": ( 668 "ExternCrateItem": (
669 options: ["NameRef", "Alias"], 669 options: ["NameRef", "Alias"],
670 ), 670 ),
671 "ArgList": ( 671 "ArgList": (
672 collections: [ 672 collections: [
673 ["args", "Expr"] 673 ("args", "Expr"),
674 ] 674 ]
675 ), 675 ),
676 "Path": ( 676 "Path": (
@@ -683,22 +683,22 @@ Grammar(
683 options: [ "NameRef", "TypeArgList" ] 683 options: [ "NameRef", "TypeArgList" ]
684 ), 684 ),
685 "TypeArgList": (collections: [ 685 "TypeArgList": (collections: [
686 ["type_args", "TypeArg"], 686 ("type_args", "TypeArg"),
687 ["lifetime_args", "LifetimeArg"], 687 ("lifetime_args", "LifetimeArg"),
688 ["assoc_type_args", "AssocTypeArg"], 688 ("assoc_type_args", "AssocTypeArg"),
689 ]), 689 ]),
690 "TypeArg": (options: ["TypeRef"]), 690 "TypeArg": (options: ["TypeRef"]),
691 "AssocTypeArg": (options: ["NameRef", "TypeRef"]), 691 "AssocTypeArg": (options: ["NameRef", "TypeRef"]),
692 "LifetimeArg": (), 692 "LifetimeArg": (),
693 693
694 "MacroItems": ( 694 "MacroItems": (
695 traits: [ "ModuleItemOwner", "FnDefOwner" ], 695 traits: [ "ModuleItemOwner", "FnDefOwner" ],
696 ), 696 ),
697 697
698 "MacroStmts" : ( 698 "MacroStmts" : (
699 options: [ "Expr" ], 699 options: [ "Expr" ],
700 collections: [ 700 collections: [
701 ["statements", "Stmt"], 701 ("statements", "Stmt"),
702 ], 702 ],
703 ) 703 )
704 }, 704 },