From 8ddbf06e39a13ed3f45e57d77727b7a35cec1749 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:24:07 +0200 Subject: Finalize structs grammar --- xtask/src/codegen/rust.ungram | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xtask') 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 = ) 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 -- cgit v1.2.3