mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Finalize structs grammar
This commit is contained in:
parent
b043947301
commit
8ddbf06e39
2 changed files with 3 additions and 5 deletions
|
@ -83,22 +83,21 @@ StructDef =
|
|||
)
|
||||
|
||||
RecordFieldList =
|
||||
'{' fields:RecordField* '}'
|
||||
'{' fields:(RecordField (',' RecordField)* ','?)? '}'
|
||||
|
||||
RecordField =
|
||||
Attr* Visibility? Name ':' ascribed_type:TypeRef
|
||||
|
||||
TupleFieldList =
|
||||
'(' fields:TupleField* ')'
|
||||
'(' fields:(TupleField (',' TupleField)* ','?)? ')'
|
||||
|
||||
TupleField =
|
||||
Attr* Visibility? Name TypeRef
|
||||
Attr* Visibility? TypeRef
|
||||
|
||||
FieldList =
|
||||
RecordFieldList
|
||||
| TupleFieldList
|
||||
|
||||
|
||||
UnionDef =
|
||||
Attr* Visibility? 'union' Name GenericParamList? WhereClause?
|
||||
RecordFieldList
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue