Skip to content

Commit 8ddbf06

Browse files
committed
Finalize structs grammar
1 parent b043947 commit 8ddbf06

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

crates/ra_syntax/src/ast/generated/nodes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ pub struct TupleField {
422422
pub(crate) syntax: SyntaxNode,
423423
}
424424
impl ast::AttrsOwner for TupleField {}
425-
impl ast::NameOwner for TupleField {}
426425
impl ast::VisibilityOwner for TupleField {}
427426
impl TupleField {
428427
pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }

xtask/src/codegen/rust.ungram

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,21 @@ StructDef =
8383
)
8484

8585
RecordFieldList =
86-
'{' fields:RecordField* '}'
86+
'{' fields:(RecordField (',' RecordField)* ','?)? '}'
8787

8888
RecordField =
8989
Attr* Visibility? Name ':' ascribed_type:TypeRef
9090

9191
TupleFieldList =
92-
'(' fields:TupleField* ')'
92+
'(' fields:(TupleField (',' TupleField)* ','?)? ')'
9393

9494
TupleField =
95-
Attr* Visibility? Name TypeRef
95+
Attr* Visibility? TypeRef
9696

9797
FieldList =
9898
RecordFieldList
9999
| TupleFieldList
100100

101-
102101
UnionDef =
103102
Attr* Visibility? 'union' Name GenericParamList? WhereClause?
104103
RecordFieldList

0 commit comments

Comments
 (0)