aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs26
-rw-r--r--crates/ra_syntax/src/grammar.ron6
2 files changed, 26 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index c73533861..334da67ef 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -2142,7 +2142,15 @@ impl<R: TreeRoot<RaTypes>> NamedFieldNode<R> {
2142} 2142}
2143 2143
2144 2144
2145impl<'a> NamedField<'a> {} 2145impl<'a> NamedField<'a> {
2146 pub fn name_ref(self) -> Option<NameRef<'a>> {
2147 super::child_opt(self)
2148 }
2149
2150 pub fn expr(self) -> Option<Expr<'a>> {
2151 super::child_opt(self)
2152 }
2153}
2146 2154
2147// NamedFieldDef 2155// NamedFieldDef
2148#[derive(Debug, Clone, Copy,)] 2156#[derive(Debug, Clone, Copy,)]
@@ -2218,7 +2226,11 @@ impl<R: TreeRoot<RaTypes>> NamedFieldListNode<R> {
2218} 2226}
2219 2227
2220 2228
2221impl<'a> NamedFieldList<'a> {} 2229impl<'a> NamedFieldList<'a> {
2230 pub fn fields(self) -> impl Iterator<Item = NamedField<'a>> + 'a {
2231 super::children(self)
2232 }
2233}
2222 2234
2223// NeverType 2235// NeverType
2224#[derive(Debug, Clone, Copy,)] 2236#[derive(Debug, Clone, Copy,)]
@@ -3467,7 +3479,15 @@ impl<R: TreeRoot<RaTypes>> StructLitNode<R> {
3467} 3479}
3468 3480
3469 3481
3470impl<'a> StructLit<'a> {} 3482impl<'a> StructLit<'a> {
3483 pub fn path(self) -> Option<Path<'a>> {
3484 super::child_opt(self)
3485 }
3486
3487 pub fn named_field_list(self) -> Option<NamedFieldList<'a>> {
3488 super::child_opt(self)
3489 }
3490}
3471 3491
3472// StructPat 3492// StructPat
3473#[derive(Debug, Clone, Copy,)] 3493#[derive(Debug, Clone, Copy,)]
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron
index e3b9032a0..0da8b8183 100644
--- a/crates/ra_syntax/src/grammar.ron
+++ b/crates/ra_syntax/src/grammar.ron
@@ -392,9 +392,9 @@ Grammar(
392 collections: [ [ "pats", "Pat" ] ] 392 collections: [ [ "pats", "Pat" ] ]
393 ), 393 ),
394 "MatchGuard": (), 394 "MatchGuard": (),
395 "StructLit": (), 395 "StructLit": (options: ["Path", "NamedFieldList"]),
396 "NamedFieldList": (), 396 "NamedFieldList": (collections: [ ["fields", "NamedField"] ]),
397 "NamedField": (), 397 "NamedField": (options: ["NameRef", "Expr"]),
398 "CallExpr": ( 398 "CallExpr": (
399 traits: ["ArgListOwner"], 399 traits: ["ArgListOwner"],
400 options: [ "Expr" ], 400 options: [ "Expr" ],