diff options
Diffstat (limited to 'crates/ra_syntax/src/grammar.ron')
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 730 |
1 files changed, 0 insertions, 730 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index e43a724f0..47446a878 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -1,736 +1,6 @@ | |||
1 | // Stores definitions which must be used in multiple places | 1 | // Stores definitions which must be used in multiple places |
2 | // See `cargo xtask codegen` (defined in xtasks/src/main.rs) | 2 | // See `cargo xtask codegen` (defined in xtasks/src/main.rs) |
3 | Grammar( | 3 | Grammar( |
4 | punct: [ | ||
5 | (";", "SEMI"), | ||
6 | (",", "COMMA"), | ||
7 | ("(", "L_PAREN"), | ||
8 | (")", "R_PAREN"), | ||
9 | ("{", "L_CURLY"), | ||
10 | ("}", "R_CURLY"), | ||
11 | ("[", "L_BRACK"), | ||
12 | ("]", "R_BRACK"), | ||
13 | ("<", "L_ANGLE"), | ||
14 | (">", "R_ANGLE"), | ||
15 | ("@", "AT"), | ||
16 | ("#", "POUND"), | ||
17 | ("~", "TILDE"), | ||
18 | ("?", "QUESTION"), | ||
19 | ("$", "DOLLAR"), | ||
20 | ("&", "AMP"), | ||
21 | ("|", "PIPE"), | ||
22 | ("+", "PLUS"), | ||
23 | ("*", "STAR"), | ||
24 | ("/", "SLASH"), | ||
25 | ("^", "CARET"), | ||
26 | ("%", "PERCENT"), | ||
27 | ("_", "UNDERSCORE"), | ||
28 | (".", "DOT"), | ||
29 | ("..", "DOTDOT"), | ||
30 | ("...", "DOTDOTDOT"), | ||
31 | ("..=", "DOTDOTEQ"), | ||
32 | (":", "COLON"), | ||
33 | ("::", "COLONCOLON"), | ||
34 | ("=", "EQ"), | ||
35 | ("==", "EQEQ"), | ||
36 | ("=>", "FAT_ARROW"), | ||
37 | ("!", "EXCL"), | ||
38 | ("!=", "NEQ"), | ||
39 | ("-", "MINUS"), | ||
40 | ("->", "THIN_ARROW"), | ||
41 | ("<=", "LTEQ"), | ||
42 | (">=", "GTEQ"), | ||
43 | ("+=", "PLUSEQ"), | ||
44 | ("-=", "MINUSEQ"), | ||
45 | ("|=", "PIPEEQ"), | ||
46 | ("&=", "AMPEQ"), | ||
47 | ("^=", "CARETEQ"), | ||
48 | ("/=", "SLASHEQ"), | ||
49 | ("*=", "STAREQ"), | ||
50 | ("%=", "PERCENTEQ"), | ||
51 | ("&&", "AMPAMP"), | ||
52 | ("||", "PIPEPIPE"), | ||
53 | ("<<", "SHL"), | ||
54 | (">>", "SHR"), | ||
55 | ("<<=", "SHLEQ"), | ||
56 | (">>=", "SHREQ"), | ||
57 | ], | ||
58 | keywords: [ | ||
59 | "async", | ||
60 | "use", | ||
61 | "fn", | ||
62 | "struct", | ||
63 | "enum", | ||
64 | "trait", | ||
65 | "impl", | ||
66 | "dyn", | ||
67 | "true", | ||
68 | "false", | ||
69 | "as", | ||
70 | "extern", | ||
71 | "crate", | ||
72 | "mod", | ||
73 | "pub", | ||
74 | "self", | ||
75 | "super", | ||
76 | "in", | ||
77 | "where", | ||
78 | "for", | ||
79 | "loop", | ||
80 | "while", | ||
81 | "continue", | ||
82 | "break", | ||
83 | "if", | ||
84 | "else", | ||
85 | "match", | ||
86 | "const", | ||
87 | "static", | ||
88 | "mut", | ||
89 | "unsafe", | ||
90 | "type", | ||
91 | "ref", | ||
92 | "let", | ||
93 | "move", | ||
94 | "return", | ||
95 | "try", | ||
96 | "box", | ||
97 | "await", | ||
98 | "macro" | ||
99 | ], | ||
100 | contextual_keywords: [ | ||
101 | "auto", | ||
102 | "default", | ||
103 | "existential", | ||
104 | "union", | ||
105 | ], | ||
106 | literals: [ | ||
107 | "INT_NUMBER", | ||
108 | "FLOAT_NUMBER", | ||
109 | "CHAR", | ||
110 | "BYTE", | ||
111 | "STRING", | ||
112 | "RAW_STRING", | ||
113 | "BYTE_STRING", | ||
114 | "RAW_BYTE_STRING", | ||
115 | ], | ||
116 | tokens: [ | ||
117 | "ERROR", | ||
118 | "IDENT", | ||
119 | "WHITESPACE", | ||
120 | "LIFETIME", | ||
121 | "COMMENT", | ||
122 | "SHEBANG", | ||
123 | "L_DOLLAR", | ||
124 | "R_DOLLAR", | ||
125 | ], | ||
126 | nodes: [ | ||
127 | "SOURCE_FILE", | ||
128 | |||
129 | "STRUCT_DEF", | ||
130 | "UNION_DEF", | ||
131 | "ENUM_DEF", | ||
132 | "FN_DEF", | ||
133 | "RET_TYPE", | ||
134 | "EXTERN_CRATE_ITEM", | ||
135 | "MODULE", | ||
136 | "USE_ITEM", | ||
137 | "STATIC_DEF", | ||
138 | "CONST_DEF", | ||
139 | "TRAIT_DEF", | ||
140 | "IMPL_BLOCK", | ||
141 | "TYPE_ALIAS_DEF", | ||
142 | "MACRO_CALL", | ||
143 | "TOKEN_TREE", | ||
144 | "MACRO_DEF", | ||
145 | |||
146 | "PAREN_TYPE", | ||
147 | "TUPLE_TYPE", | ||
148 | "NEVER_TYPE", | ||
149 | "PATH_TYPE", | ||
150 | "POINTER_TYPE", | ||
151 | "ARRAY_TYPE", | ||
152 | "SLICE_TYPE", | ||
153 | "REFERENCE_TYPE", | ||
154 | "PLACEHOLDER_TYPE", | ||
155 | "FN_POINTER_TYPE", | ||
156 | "FOR_TYPE", | ||
157 | "IMPL_TRAIT_TYPE", | ||
158 | "DYN_TRAIT_TYPE", | ||
159 | |||
160 | "REF_PAT", | ||
161 | "BOX_PAT", | ||
162 | "BIND_PAT", | ||
163 | "PLACEHOLDER_PAT", | ||
164 | "DOT_DOT_PAT", | ||
165 | "PATH_PAT", | ||
166 | "RECORD_PAT", | ||
167 | "RECORD_FIELD_PAT_LIST", | ||
168 | "RECORD_FIELD_PAT", | ||
169 | "TUPLE_STRUCT_PAT", | ||
170 | "TUPLE_PAT", | ||
171 | "SLICE_PAT", | ||
172 | "RANGE_PAT", | ||
173 | "LITERAL_PAT", | ||
174 | |||
175 | // atoms | ||
176 | "TUPLE_EXPR", | ||
177 | "ARRAY_EXPR", | ||
178 | "PAREN_EXPR", | ||
179 | "PATH_EXPR", | ||
180 | "LAMBDA_EXPR", | ||
181 | "IF_EXPR", | ||
182 | "WHILE_EXPR", | ||
183 | "CONDITION", | ||
184 | "LOOP_EXPR", | ||
185 | "FOR_EXPR", | ||
186 | "CONTINUE_EXPR", | ||
187 | "BREAK_EXPR", | ||
188 | "LABEL", | ||
189 | "BLOCK_EXPR", | ||
190 | "RETURN_EXPR", | ||
191 | "MATCH_EXPR", | ||
192 | "MATCH_ARM_LIST", | ||
193 | "MATCH_ARM", | ||
194 | "MATCH_GUARD", | ||
195 | "RECORD_LIT", | ||
196 | "RECORD_FIELD_LIST", | ||
197 | "RECORD_FIELD", | ||
198 | "TRY_BLOCK_EXPR", | ||
199 | "BOX_EXPR", | ||
200 | |||
201 | // postfix | ||
202 | "CALL_EXPR", | ||
203 | "INDEX_EXPR", | ||
204 | "METHOD_CALL_EXPR", | ||
205 | "FIELD_EXPR", | ||
206 | "AWAIT_EXPR", | ||
207 | "TRY_EXPR", | ||
208 | "CAST_EXPR", | ||
209 | |||
210 | // unary | ||
211 | "REF_EXPR", | ||
212 | "PREFIX_EXPR", | ||
213 | |||
214 | "RANGE_EXPR", // just weird | ||
215 | "BIN_EXPR", | ||
216 | |||
217 | "BLOCK", | ||
218 | "EXTERN_BLOCK", | ||
219 | "EXTERN_ITEM_LIST", | ||
220 | "ENUM_VARIANT", | ||
221 | "RECORD_FIELD_DEF_LIST", | ||
222 | "RECORD_FIELD_DEF", | ||
223 | "TUPLE_FIELD_DEF_LIST", | ||
224 | "TUPLE_FIELD_DEF", | ||
225 | "ENUM_VARIANT_LIST", | ||
226 | "ITEM_LIST", | ||
227 | "ATTR", | ||
228 | "META_ITEM", // not an item actually | ||
229 | "USE_TREE", | ||
230 | "USE_TREE_LIST", | ||
231 | "PATH", | ||
232 | "PATH_SEGMENT", | ||
233 | "LITERAL", | ||
234 | "ALIAS", | ||
235 | "VISIBILITY", | ||
236 | "WHERE_CLAUSE", | ||
237 | "WHERE_PRED", | ||
238 | "ABI", | ||
239 | "NAME", | ||
240 | "NAME_REF", | ||
241 | |||
242 | "LET_STMT", | ||
243 | "EXPR_STMT", | ||
244 | |||
245 | "TYPE_PARAM_LIST", | ||
246 | "LIFETIME_PARAM", | ||
247 | "TYPE_PARAM", | ||
248 | "CONST_PARAM", | ||
249 | "TYPE_ARG_LIST", | ||
250 | "LIFETIME_ARG", | ||
251 | "TYPE_ARG", | ||
252 | "ASSOC_TYPE_ARG", | ||
253 | |||
254 | "PARAM_LIST", | ||
255 | "PARAM", | ||
256 | "SELF_PARAM", | ||
257 | "ARG_LIST", | ||
258 | "TYPE_BOUND", | ||
259 | "TYPE_BOUND_LIST", | ||
260 | |||
261 | // macro related | ||
262 | "MACRO_ITEMS", | ||
263 | "MACRO_STMTS", | ||
264 | ], | ||
265 | ast: { | 4 | ast: { |
266 | "SourceFile": ( | ||
267 | traits: [ "ModuleItemOwner", "FnDefOwner" ], | ||
268 | collections: [ | ||
269 | ("modules", "Module"), | ||
270 | ] | ||
271 | ), | ||
272 | "FnDef": ( | ||
273 | traits: [ | ||
274 | "VisibilityOwner", | ||
275 | "NameOwner", | ||
276 | "TypeParamsOwner", | ||
277 | "AttrsOwner", | ||
278 | "DocCommentsOwner" | ||
279 | ], | ||
280 | options: [ "ParamList", ["body", "BlockExpr"], "RetType" ], | ||
281 | ), | ||
282 | "RetType": (options: ["TypeRef"]), | ||
283 | "StructDef": ( | ||
284 | traits: [ | ||
285 | "VisibilityOwner", | ||
286 | "NameOwner", | ||
287 | "TypeParamsOwner", | ||
288 | "AttrsOwner", | ||
289 | "DocCommentsOwner" | ||
290 | ] | ||
291 | ), | ||
292 | "UnionDef": ( | ||
293 | traits: [ | ||
294 | "VisibilityOwner", | ||
295 | "NameOwner", | ||
296 | "TypeParamsOwner", | ||
297 | "AttrsOwner", | ||
298 | "DocCommentsOwner" | ||
299 | ], | ||
300 | options: ["RecordFieldDefList"], | ||
301 | ), | ||
302 | "RecordFieldDefList": (collections: [("fields", "RecordFieldDef")]), | ||
303 | "RecordFieldDef": ( | ||
304 | traits: [ | ||
305 | "VisibilityOwner", | ||
306 | "NameOwner", | ||
307 | "AttrsOwner", | ||
308 | "DocCommentsOwner", | ||
309 | "TypeAscriptionOwner" | ||
310 | ] | ||
311 | ), | ||
312 | "TupleFieldDefList": (collections: [("fields", "TupleFieldDef")]), | ||
313 | "TupleFieldDef": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]), | ||
314 | "EnumDef": ( traits: [ | ||
315 | "VisibilityOwner", | ||
316 | "NameOwner", | ||
317 | "TypeParamsOwner", | ||
318 | "AttrsOwner", | ||
319 | "DocCommentsOwner" | ||
320 | ], options: [["variant_list", "EnumVariantList"]] ), | ||
321 | "EnumVariantList": ( collections: [("variants", "EnumVariant")] ), | ||
322 | "EnumVariant": ( traits: ["NameOwner", "DocCommentsOwner", "AttrsOwner"], options: ["Expr"] ), | ||
323 | "TraitDef": ( | ||
324 | traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner", "TypeParamsOwner", "TypeBoundsOwner"], | ||
325 | options: ["ItemList"] | ||
326 | ), | ||
327 | "Module": ( | ||
328 | traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ], | ||
329 | options: [ "ItemList" ] | ||
330 | ), | ||
331 | "ItemList": ( | ||
332 | collections: [("impl_items", "ImplItem")], | ||
333 | traits: [ "FnDefOwner", "ModuleItemOwner" ], | ||
334 | ), | ||
335 | "ConstDef": ( | ||
336 | traits: [ | ||
337 | "VisibilityOwner", | ||
338 | "NameOwner", | ||
339 | "TypeParamsOwner", | ||
340 | "AttrsOwner", | ||
341 | "DocCommentsOwner", | ||
342 | "TypeAscriptionOwner", | ||
343 | ], | ||
344 | options: [ ["body","Expr"]], | ||
345 | ), | ||
346 | "StaticDef": ( | ||
347 | traits: [ | ||
348 | "VisibilityOwner", | ||
349 | "NameOwner", | ||
350 | "TypeParamsOwner", | ||
351 | "AttrsOwner", | ||
352 | "DocCommentsOwner", | ||
353 | "TypeAscriptionOwner", | ||
354 | ], | ||
355 | options: [ ["body","Expr"]], | ||
356 | ), | ||
357 | "TypeAliasDef": ( | ||
358 | traits: [ | ||
359 | "VisibilityOwner", | ||
360 | "NameOwner", | ||
361 | "TypeParamsOwner", | ||
362 | "AttrsOwner", | ||
363 | "DocCommentsOwner", | ||
364 | "TypeBoundsOwner", | ||
365 | ], | ||
366 | options: ["TypeRef"] | ||
367 | ), | ||
368 | "ImplBlock": (options: ["ItemList"], traits: ["TypeParamsOwner", "AttrsOwner"]), | ||
369 | |||
370 | "ParenType": (options: ["TypeRef"]), | ||
371 | "TupleType": ( collections: [("fields", "TypeRef")] ), | ||
372 | "NeverType": (), | ||
373 | "PathType": (options: ["Path"]), | ||
374 | "PointerType": (options: ["TypeRef"]), | ||
375 | "ArrayType": ( options: ["TypeRef", "Expr"] ), | ||
376 | "SliceType": ( options: ["TypeRef"] ), | ||
377 | "ReferenceType": (options: ["TypeRef"]), | ||
378 | "PlaceholderType": (), | ||
379 | "FnPointerType": (options: ["ParamList", "RetType"]), | ||
380 | "ForType": (options: ["TypeRef"]), | ||
381 | "ImplTraitType": ( | ||
382 | traits: ["TypeBoundsOwner"], | ||
383 | ), | ||
384 | "DynTraitType": ( | ||
385 | traits: ["TypeBoundsOwner"], | ||
386 | ), | ||
387 | |||
388 | "TypeRef": ( enum: [ | ||
389 | "ParenType", | ||
390 | "TupleType", | ||
391 | "NeverType", | ||
392 | "PathType", | ||
393 | "PointerType", | ||
394 | "ArrayType", | ||
395 | "SliceType", | ||
396 | "ReferenceType", | ||
397 | "PlaceholderType", | ||
398 | "FnPointerType", | ||
399 | "ForType", | ||
400 | "ImplTraitType", | ||
401 | "DynTraitType", | ||
402 | ]), | ||
403 | |||
404 | "NominalDef": ( | ||
405 | enum: ["StructDef", "EnumDef", "UnionDef"], | ||
406 | traits: [ | ||
407 | "NameOwner", | ||
408 | "TypeParamsOwner", | ||
409 | "AttrsOwner" | ||
410 | ], | ||
411 | ), | ||
412 | "ModuleItem": ( | ||
413 | enum: ["StructDef", "UnionDef", "EnumDef", "FnDef", "TraitDef", "TypeAliasDef", "ImplBlock", | ||
414 | "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ], | ||
415 | traits: ["AttrsOwner", "VisibilityOwner"], | ||
416 | ), | ||
417 | "ImplItem": ( | ||
418 | enum: ["FnDef", "TypeAliasDef", "ConstDef"], | ||
419 | traits: ["AttrsOwner"] | ||
420 | ), | ||
421 | |||
422 | "TupleExpr": ( | ||
423 | collections: [("exprs", "Expr")] | ||
424 | ), | ||
425 | "ArrayExpr": ( | ||
426 | collections: [("exprs", "Expr")] | ||
427 | ), | ||
428 | "ParenExpr": (options: ["Expr"]), | ||
429 | "PathExpr": (options: ["Path"]), | ||
430 | "LambdaExpr": ( | ||
431 | options: [ | ||
432 | "ParamList", "RetType", | ||
433 | ["body", "Expr"], | ||
434 | ] | ||
435 | ), | ||
436 | "IfExpr": ( | ||
437 | options: [ "Condition" ] | ||
438 | ), | ||
439 | "LoopExpr": ( | ||
440 | traits: ["LoopBodyOwner"], | ||
441 | ), | ||
442 | "TryBlockExpr": ( | ||
443 | options: [["body", "BlockExpr"]], | ||
444 | ), | ||
445 | "ForExpr": ( | ||
446 | traits: ["LoopBodyOwner"], | ||
447 | options: [ | ||
448 | "Pat", | ||
449 | ["iterable", "Expr"], | ||
450 | ] | ||
451 | ), | ||
452 | "WhileExpr": ( | ||
453 | traits: ["LoopBodyOwner"], | ||
454 | options: [ "Condition" ] | ||
455 | ), | ||
456 | "ContinueExpr": (), | ||
457 | "BreakExpr": (options: ["Expr"]), | ||
458 | "Label": (), | ||
459 | "BlockExpr": ( | ||
460 | options: [ "Block" ] | ||
461 | ), | ||
462 | "ReturnExpr": (options: ["Expr"]), | ||
463 | "MatchExpr": ( | ||
464 | options: [ "Expr", "MatchArmList" ], | ||
465 | ), | ||
466 | "MatchArmList": ( | ||
467 | collections: [ ("arms", "MatchArm") ], | ||
468 | traits: [ "AttrsOwner" ] | ||
469 | ), | ||
470 | "MatchArm": ( | ||
471 | options: [ | ||
472 | [ "guard", "MatchGuard" ], | ||
473 | "Expr", | ||
474 | ], | ||
475 | collections: [ ("pats", "Pat") ], | ||
476 | traits: [ "AttrsOwner" ] | ||
477 | ), | ||
478 | "MatchGuard": (options: ["Expr"]), | ||
479 | "RecordLit": (options: ["Path", "RecordFieldList"]), | ||
480 | "RecordFieldList": ( | ||
481 | collections: [ ("fields", "RecordField") ], | ||
482 | options: [["spread", "Expr"]] | ||
483 | ), | ||
484 | "RecordField": (options: ["NameRef", "Expr"]), | ||
485 | "CallExpr": ( | ||
486 | traits: ["ArgListOwner"], | ||
487 | options: [ "Expr" ], | ||
488 | ), | ||
489 | "MethodCallExpr": ( | ||
490 | traits: ["ArgListOwner"], | ||
491 | options: [ "Expr", "NameRef", "TypeArgList" ], | ||
492 | ), | ||
493 | "IndexExpr": (), | ||
494 | "FieldExpr": (options: ["Expr", "NameRef"]), | ||
495 | "AwaitExpr": (options: ["Expr"]), | ||
496 | "TryExpr": (options: ["Expr"]), | ||
497 | "CastExpr": (options: ["Expr", "TypeRef"]), | ||
498 | "RefExpr": (options: ["Expr"]), | ||
499 | "PrefixExpr": (options: ["Expr"]), | ||
500 | "BoxExpr": (options: ["Expr"]), | ||
501 | "RangeExpr": (), | ||
502 | "BinExpr": (), | ||
503 | |||
504 | "Literal": (), | ||
505 | |||
506 | "Expr": ( | ||
507 | enum: [ | ||
508 | "TupleExpr", | ||
509 | "ArrayExpr", | ||
510 | "ParenExpr", | ||
511 | "PathExpr", | ||
512 | "LambdaExpr", | ||
513 | "IfExpr", | ||
514 | "LoopExpr", | ||
515 | "ForExpr", | ||
516 | "WhileExpr", | ||
517 | "ContinueExpr", | ||
518 | "BreakExpr", | ||
519 | "Label", | ||
520 | "BlockExpr", | ||
521 | "ReturnExpr", | ||
522 | "MatchExpr", | ||
523 | "RecordLit", | ||
524 | "CallExpr", | ||
525 | "IndexExpr", | ||
526 | "MethodCallExpr", | ||
527 | "FieldExpr", | ||
528 | "AwaitExpr", | ||
529 | "TryExpr", | ||
530 | "TryBlockExpr", | ||
531 | "CastExpr", | ||
532 | "RefExpr", | ||
533 | "PrefixExpr", | ||
534 | "RangeExpr", | ||
535 | "BinExpr", | ||
536 | "Literal", | ||
537 | "MacroCall", | ||
538 | "BoxExpr", | ||
539 | ], | ||
540 | ), | ||
541 | |||
542 | "RefPat": ( options: [ "Pat" ]), | ||
543 | "BoxPat": ( options: [ "Pat" ]), | ||
544 | "BindPat": ( | ||
545 | options: [ "Pat" ], | ||
546 | traits: ["NameOwner"] | ||
547 | ), | ||
548 | "PlaceholderPat": (), | ||
549 | "DotDotPat": (), | ||
550 | "PathPat": ( options: [ "Path" ] ), | ||
551 | "RecordPat": ( options: ["RecordFieldPatList", "Path"] ), | ||
552 | "RecordFieldPatList": ( | ||
553 | collections: [ | ||
554 | ("record_field_pats", "RecordFieldPat"), | ||
555 | ("bind_pats", "BindPat"), | ||
556 | ] | ||
557 | ), | ||
558 | "RecordFieldPat": ( | ||
559 | traits: ["NameOwner"], | ||
560 | options: ["Pat"] | ||
561 | ), | ||
562 | "TupleStructPat": ( | ||
563 | options: ["Path"], | ||
564 | collections: [("args", "Pat")], | ||
565 | ), | ||
566 | "TuplePat": ( collections: [("args", "Pat")] ), | ||
567 | "SlicePat": (), | ||
568 | "RangePat": (), | ||
569 | "LiteralPat": (options: ["Literal"]), | ||
570 | |||
571 | "Pat": ( | ||
572 | enum: [ | ||
573 | "RefPat", | ||
574 | "BoxPat", | ||
575 | "BindPat", | ||
576 | "PlaceholderPat", | ||
577 | "DotDotPat", | ||
578 | "PathPat", | ||
579 | "RecordPat", | ||
580 | "TupleStructPat", | ||
581 | "TuplePat", | ||
582 | "SlicePat", | ||
583 | "RangePat", | ||
584 | "LiteralPat", | ||
585 | ], | ||
586 | ), | ||
587 | |||
588 | "Visibility": (), | ||
589 | "Name": (), | ||
590 | "NameRef": (), | ||
591 | "MacroCall": ( | ||
592 | traits: [ "NameOwner", "AttrsOwner","DocCommentsOwner" ], | ||
593 | options: [ "TokenTree", "Path" ], | ||
594 | ), | ||
595 | "AttrInput": ( enum: [ "Literal", "TokenTree" ] ), | ||
596 | "Attr": ( options: [ "Path", [ "input", "AttrInput" ] ] ), | ||
597 | "TokenTree": (), | ||
598 | "TypeParamList": ( | ||
599 | collections: [ | ||
600 | ("type_params", "TypeParam" ), | ||
601 | ("lifetime_params", "LifetimeParam" ), | ||
602 | ] | ||
603 | ), | ||
604 | "TypeParam": ( | ||
605 | options: [("default_type", "TypeRef")], | ||
606 | traits: ["NameOwner", "AttrsOwner", "TypeBoundsOwner"], | ||
607 | ), | ||
608 | "ConstParam": ( | ||
609 | options: [("default_val", "Expr")], | ||
610 | traits: ["NameOwner", "AttrsOwner", "TypeAscriptionOwner"], | ||
611 | ), | ||
612 | "LifetimeParam": ( | ||
613 | traits: ["AttrsOwner"], | ||
614 | ), | ||
615 | "TypeBound": ( | ||
616 | options: [ | ||
617 | "TypeRef", | ||
618 | ] | ||
619 | ), | ||
620 | "TypeBoundList": ( | ||
621 | collections: [ | ||
622 | ("bounds", "TypeBound"), | ||
623 | ] | ||
624 | ), | ||
625 | "WherePred": ( | ||
626 | options: [ | ||
627 | "TypeRef", | ||
628 | ], | ||
629 | traits: [ | ||
630 | "TypeBoundsOwner", | ||
631 | ], | ||
632 | ), | ||
633 | "WhereClause": ( | ||
634 | collections: [ | ||
635 | ("predicates", "WherePred"), | ||
636 | ], | ||
637 | ), | ||
638 | "ExprStmt": ( | ||
639 | options: [ ["expr", "Expr"] ] | ||
640 | ), | ||
641 | "LetStmt": ( | ||
642 | options: [ | ||
643 | ["pat", "Pat"], | ||
644 | ["initializer", "Expr"], | ||
645 | ], | ||
646 | traits: [ | ||
647 | "TypeAscriptionOwner", | ||
648 | ] | ||
649 | ), | ||
650 | "Condition": ( | ||
651 | options: [ "Pat", "Expr" ] | ||
652 | ), | ||
653 | "Stmt": ( | ||
654 | enum: ["ExprStmt", "LetStmt"], | ||
655 | ), | ||
656 | "Block": ( | ||
657 | options: [ "Expr" ], | ||
658 | collections: [ | ||
659 | ("statements", "Stmt"), | ||
660 | ], | ||
661 | traits: [ | ||
662 | "AttrsOwner", | ||
663 | "ModuleItemOwner", | ||
664 | ] | ||
665 | ), | ||
666 | "ParamList": ( | ||
667 | options: [ "SelfParam" ], | ||
668 | collections: [ | ||
669 | ("params", "Param"), | ||
670 | ] | ||
671 | ), | ||
672 | "SelfParam": ( | ||
673 | traits: [ | ||
674 | "TypeAscriptionOwner", | ||
675 | "AttrsOwner", | ||
676 | ] | ||
677 | ), | ||
678 | "Param": ( | ||
679 | options: [ "Pat" ], | ||
680 | traits: [ | ||
681 | "TypeAscriptionOwner", | ||
682 | "AttrsOwner", | ||
683 | ] | ||
684 | ), | ||
685 | "UseItem": ( | ||
686 | traits: ["AttrsOwner", "VisibilityOwner"], | ||
687 | options: [ "UseTree" ], | ||
688 | ), | ||
689 | "UseTree": ( | ||
690 | options: [ "Path", "UseTreeList", "Alias" ] | ||
691 | ), | ||
692 | "Alias": ( | ||
693 | traits: ["NameOwner"], | ||
694 | ), | ||
695 | "UseTreeList": ( | ||
696 | collections: [("use_trees", "UseTree")] | ||
697 | ), | ||
698 | "ExternCrateItem": ( | ||
699 | traits: ["AttrsOwner", "VisibilityOwner"], | ||
700 | options: ["NameRef", "Alias"], | ||
701 | ), | ||
702 | "ArgList": ( | ||
703 | collections: [ | ||
704 | ("args", "Expr"), | ||
705 | ] | ||
706 | ), | ||
707 | "Path": ( | ||
708 | options: [ | ||
709 | ["segment", "PathSegment"], | ||
710 | ["qualifier", "Path"], | ||
711 | ] | ||
712 | ), | ||
713 | "PathSegment": ( | ||
714 | options: [ "NameRef", "TypeArgList", "ParamList", "RetType", "PathType" ] | ||
715 | ), | ||
716 | "TypeArgList": (collections: [ | ||
717 | ("type_args", "TypeArg"), | ||
718 | ("lifetime_args", "LifetimeArg"), | ||
719 | ("assoc_type_args", "AssocTypeArg"), | ||
720 | ]), | ||
721 | "TypeArg": (options: ["TypeRef"]), | ||
722 | "AssocTypeArg": (options: ["NameRef", "TypeRef"]), | ||
723 | "LifetimeArg": (), | ||
724 | |||
725 | "MacroItems": ( | ||
726 | traits: [ "ModuleItemOwner", "FnDefOwner" ], | ||
727 | ), | ||
728 | |||
729 | "MacroStmts" : ( | ||
730 | options: [ "Expr" ], | ||
731 | collections: [ | ||
732 | ("statements", "Stmt"), | ||
733 | ], | ||
734 | ) | ||
735 | }, | 5 | }, |
736 | ) | 6 | ) |