diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 16:24:07 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 16:24:07 +0100 |
commit | 8ddbf06e39a13ed3f45e57d77727b7a35cec1749 (patch) | |
tree | 869f53eae0bf8b27c43ab7b8722a061d680b7d86 | |
parent | b043947301e9c386c9131d7008ee90a315f48545 (diff) |
Finalize structs grammar
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 1 | ||||
-rw-r--r-- | xtask/src/codegen/rust.ungram | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 46d73215c..1776fb6e6 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -422,7 +422,6 @@ pub struct TupleField { | |||
422 | pub(crate) syntax: SyntaxNode, | 422 | pub(crate) syntax: SyntaxNode, |
423 | } | 423 | } |
424 | impl ast::AttrsOwner for TupleField {} | 424 | impl ast::AttrsOwner for TupleField {} |
425 | impl ast::NameOwner for TupleField {} | ||
426 | impl ast::VisibilityOwner for TupleField {} | 425 | impl ast::VisibilityOwner for TupleField {} |
427 | impl TupleField { | 426 | impl TupleField { |
428 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 427 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index ba922af0d..28b50f021 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram | |||
@@ -83,22 +83,21 @@ StructDef = | |||
83 | ) | 83 | ) |
84 | 84 | ||
85 | RecordFieldList = | 85 | RecordFieldList = |
86 | '{' fields:RecordField* '}' | 86 | '{' fields:(RecordField (',' RecordField)* ','?)? '}' |
87 | 87 | ||
88 | RecordField = | 88 | RecordField = |
89 | Attr* Visibility? Name ':' ascribed_type:TypeRef | 89 | Attr* Visibility? Name ':' ascribed_type:TypeRef |
90 | 90 | ||
91 | TupleFieldList = | 91 | TupleFieldList = |
92 | '(' fields:TupleField* ')' | 92 | '(' fields:(TupleField (',' TupleField)* ','?)? ')' |
93 | 93 | ||
94 | TupleField = | 94 | TupleField = |
95 | Attr* Visibility? Name TypeRef | 95 | Attr* Visibility? TypeRef |
96 | 96 | ||
97 | FieldList = | 97 | FieldList = |
98 | RecordFieldList | 98 | RecordFieldList |
99 | | TupleFieldList | 99 | | TupleFieldList |
100 | 100 | ||
101 | |||
102 | UnionDef = | 101 | UnionDef = |
103 | Attr* Visibility? 'union' Name GenericParamList? WhereClause? | 102 | Attr* Visibility? 'union' Name GenericParamList? WhereClause? |
104 | RecordFieldList | 103 | RecordFieldList |