aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar.ron
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar.ron')
-rw-r--r--crates/ra_syntax/src/grammar.ron28
1 files changed, 20 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index aab4839a9..c55e9e07a 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -128,7 +128,7 @@ Grammar(
128 "STATIC_DEF", 128 "STATIC_DEF",
129 "CONST_DEF", 129 "CONST_DEF",
130 "TRAIT_DEF", 130 "TRAIT_DEF",
131 "IMPL_ITEM", 131 "IMPL_BLOCK",
132 "TYPE_DEF", 132 "TYPE_DEF",
133 "MACRO_CALL", 133 "MACRO_CALL",
134 "TOKEN_TREE", 134 "TOKEN_TREE",
@@ -247,6 +247,7 @@ Grammar(
247 ), 247 ),
248 "FnDef": ( 248 "FnDef": (
249 traits: [ 249 traits: [
250 "VisibilityOwner",
250 "NameOwner", 251 "NameOwner",
251 "TypeParamsOwner", 252 "TypeParamsOwner",
252 "AttrsOwner", 253 "AttrsOwner",
@@ -257,6 +258,7 @@ Grammar(
257 "RetType": (options: ["TypeRef"]), 258 "RetType": (options: ["TypeRef"]),
258 "StructDef": ( 259 "StructDef": (
259 traits: [ 260 traits: [
261 "VisibilityOwner",
260 "NameOwner", 262 "NameOwner",
261 "TypeParamsOwner", 263 "TypeParamsOwner",
262 "AttrsOwner", 264 "AttrsOwner",
@@ -264,10 +266,11 @@ Grammar(
264 ] 266 ]
265 ), 267 ),
266 "NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]), 268 "NamedFieldDefList": (collections: [["fields", "NamedFieldDef"]]),
267 "NamedFieldDef": ( traits: ["NameOwner", "AttrsOwner"], options: ["TypeRef"] ), 269 "NamedFieldDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner"], options: ["TypeRef"] ),
268 "PosFieldList": (collections: [["fields", "PosField"]]), 270 "PosFieldList": (collections: [["fields", "PosField"]]),
269 "PosField": ( traits: ["AttrsOwner"], options: ["TypeRef"]), 271 "PosField": ( traits: ["VisibilityOwner", "AttrsOwner"], options: ["TypeRef"]),
270 "EnumDef": ( traits: [ 272 "EnumDef": ( traits: [
273 "VisibilityOwner",
271 "NameOwner", 274 "NameOwner",
272 "TypeParamsOwner", 275 "TypeParamsOwner",
273 "AttrsOwner", 276 "AttrsOwner",
@@ -275,33 +278,37 @@ Grammar(
275 ], options: [["variant_list", "EnumVariantList"]] ), 278 ], options: [["variant_list", "EnumVariantList"]] ),
276 "EnumVariantList": ( collections: [["variants", "EnumVariant"]] ), 279 "EnumVariantList": ( collections: [["variants", "EnumVariant"]] ),
277 "EnumVariant": ( traits: ["NameOwner"], options: ["Expr"] ), 280 "EnumVariant": ( traits: ["NameOwner"], options: ["Expr"] ),
278 "TraitDef": ( traits: ["NameOwner", "AttrsOwner", "DocCommentsOwner"] ), 281 "TraitDef": ( traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner"] ),
279 "Module": ( 282 "Module": (
280 traits: ["NameOwner", "AttrsOwner", "DocCommentsOwner" ], 283 traits: ["VisibilityOwner", "NameOwner", "AttrsOwner", "DocCommentsOwner" ],
281 options: [ "ItemList" ] 284 options: [ "ItemList" ]
282 ), 285 ),
283 "ItemList": ( 286 "ItemList": (
287 collections: [["impl_items", "ImplItem"]],
284 traits: [ "FnDefOwner", "ModuleItemOwner" ], 288 traits: [ "FnDefOwner", "ModuleItemOwner" ],
285 ), 289 ),
286 "ConstDef": ( traits: [ 290 "ConstDef": ( traits: [
291 "VisibilityOwner",
287 "NameOwner", 292 "NameOwner",
288 "TypeParamsOwner", 293 "TypeParamsOwner",
289 "AttrsOwner", 294 "AttrsOwner",
290 "DocCommentsOwner" 295 "DocCommentsOwner"
291 ] ), 296 ] ),
292 "StaticDef": ( traits: [ 297 "StaticDef": ( traits: [
298 "VisibilityOwner",
293 "NameOwner", 299 "NameOwner",
294 "TypeParamsOwner", 300 "TypeParamsOwner",
295 "AttrsOwner", 301 "AttrsOwner",
296 "DocCommentsOwner" 302 "DocCommentsOwner"
297 ] ), 303 ] ),
298 "TypeDef": ( traits: [ 304 "TypeDef": ( traits: [
305 "VisibilityOwner",
299 "NameOwner", 306 "NameOwner",
300 "TypeParamsOwner", 307 "TypeParamsOwner",
301 "AttrsOwner", 308 "AttrsOwner",
302 "DocCommentsOwner" 309 "DocCommentsOwner"
303 ] ), 310 ] ),
304 "ImplItem": (), 311 "ImplBlock": (options: ["ItemList"]),
305 312
306 "ParenType": (options: ["TypeRef"]), 313 "ParenType": (options: ["TypeRef"]),
307 "TupleType": ( collections: [["fields", "TypeRef"]] ), 314 "TupleType": ( collections: [["fields", "TypeRef"]] ),
@@ -342,9 +349,12 @@ Grammar(
342 ], 349 ],
343 ), 350 ),
344 "ModuleItem": ( 351 "ModuleItem": (
345 enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeDef", "ImplItem", 352 enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeDef", "ImplBlock",
346 "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ] 353 "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ]
347 ), 354 ),
355 "ImplItem": (
356 enum: ["FnDef", "TypeDef", "ConstDef"]
357 ),
348 358
349 "TupleExpr": (), 359 "TupleExpr": (),
350 "ArrayExpr": (), 360 "ArrayExpr": (),
@@ -482,6 +492,7 @@ Grammar(
482 ], 492 ],
483 ), 493 ),
484 494
495 "Visibility": (),
485 "Name": (), 496 "Name": (),
486 "NameRef": (), 497 "NameRef": (),
487 "MacroCall": ( options: [ "TokenTree", "Path" ] ), 498 "MacroCall": ( options: [ "TokenTree", "Path" ] ),
@@ -523,7 +534,8 @@ Grammar(
523 ["params", "Param"] 534 ["params", "Param"]
524 ] 535 ]
525 ), 536 ),
526 "SelfParam": (), 537 "SelfParam": (options: ["TypeRef", "SelfKw"]),
538 "SelfKw": (),
527 "Param": ( 539 "Param": (
528 options: [ "Pat", "TypeRef" ], 540 options: [ "Pat", "TypeRef" ],
529 ), 541 ),