diff options
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 8 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 89d3a35c5..e73fe22e9 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -2371,6 +2371,10 @@ impl NamedFieldList { | |||
2371 | pub fn fields(&self) -> impl Iterator<Item = &NamedField> { | 2371 | pub fn fields(&self) -> impl Iterator<Item = &NamedField> { |
2372 | super::children(self) | 2372 | super::children(self) |
2373 | } | 2373 | } |
2374 | |||
2375 | pub fn spread(&self) -> Option<&Expr> { | ||
2376 | super::child_opt(self) | ||
2377 | } | ||
2374 | } | 2378 | } |
2375 | 2379 | ||
2376 | // NeverType | 2380 | // NeverType |
@@ -3564,10 +3568,6 @@ impl StructLit { | |||
3564 | pub fn named_field_list(&self) -> Option<&NamedFieldList> { | 3568 | pub fn named_field_list(&self) -> Option<&NamedFieldList> { |
3565 | super::child_opt(self) | 3569 | super::child_opt(self) |
3566 | } | 3570 | } |
3567 | |||
3568 | pub fn spread(&self) -> Option<&Expr> { | ||
3569 | super::child_opt(self) | ||
3570 | } | ||
3571 | } | 3571 | } |
3572 | 3572 | ||
3573 | // StructPat | 3573 | // StructPat |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index c7abdd6dc..b8665bbc8 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -451,8 +451,11 @@ Grammar( | |||
451 | traits: [ "AttrsOwner" ] | 451 | traits: [ "AttrsOwner" ] |
452 | ), | 452 | ), |
453 | "MatchGuard": (options: ["Expr"]), | 453 | "MatchGuard": (options: ["Expr"]), |
454 | "StructLit": (options: ["Path", "NamedFieldList", ["spread", "Expr"]]), | 454 | "StructLit": (options: ["Path", "NamedFieldList"]), |
455 | "NamedFieldList": (collections: [ ["fields", "NamedField"] ]), | 455 | "NamedFieldList": ( |
456 | collections: [ ["fields", "NamedField"] ], | ||
457 | options: [["spread", "Expr"]] | ||
458 | ), | ||
456 | "NamedField": (options: ["NameRef", "Expr"]), | 459 | "NamedField": (options: ["NameRef", "Expr"]), |
457 | "CallExpr": ( | 460 | "CallExpr": ( |
458 | traits: ["ArgListOwner"], | 461 | traits: ["ArgListOwner"], |