mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Finalize structs grammar
This commit is contained in:
parent
b043947301
commit
8ddbf06e39
2 changed files with 3 additions and 5 deletions
|
@ -422,7 +422,6 @@ pub struct TupleField {
|
||||||
pub(crate) syntax: SyntaxNode,
|
pub(crate) syntax: SyntaxNode,
|
||||||
}
|
}
|
||||||
impl ast::AttrsOwner for TupleField {}
|
impl ast::AttrsOwner for TupleField {}
|
||||||
impl ast::NameOwner for TupleField {}
|
|
||||||
impl ast::VisibilityOwner for TupleField {}
|
impl ast::VisibilityOwner for TupleField {}
|
||||||
impl TupleField {
|
impl TupleField {
|
||||||
pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
|
pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
|
||||||
|
|
|
@ -83,22 +83,21 @@ StructDef =
|
||||||
)
|
)
|
||||||
|
|
||||||
RecordFieldList =
|
RecordFieldList =
|
||||||
'{' fields:RecordField* '}'
|
'{' fields:(RecordField (',' RecordField)* ','?)? '}'
|
||||||
|
|
||||||
RecordField =
|
RecordField =
|
||||||
Attr* Visibility? Name ':' ascribed_type:TypeRef
|
Attr* Visibility? Name ':' ascribed_type:TypeRef
|
||||||
|
|
||||||
TupleFieldList =
|
TupleFieldList =
|
||||||
'(' fields:TupleField* ')'
|
'(' fields:(TupleField (',' TupleField)* ','?)? ')'
|
||||||
|
|
||||||
TupleField =
|
TupleField =
|
||||||
Attr* Visibility? Name TypeRef
|
Attr* Visibility? TypeRef
|
||||||
|
|
||||||
FieldList =
|
FieldList =
|
||||||
RecordFieldList
|
RecordFieldList
|
||||||
| TupleFieldList
|
| TupleFieldList
|
||||||
|
|
||||||
|
|
||||||
UnionDef =
|
UnionDef =
|
||||||
Attr* Visibility? 'union' Name GenericParamList? WhereClause?
|
Attr* Visibility? 'union' Name GenericParamList? WhereClause?
|
||||||
RecordFieldList
|
RecordFieldList
|
||||||
|
|
Loading…
Reference in a new issue