From 98ec5f2c21d0072e4811309ac111db75b87146d1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:12:35 +0200 Subject: Minor, reorder --- xtask/src/codegen/rust.ungram | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 833ffd9e0..7f3063efb 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -82,10 +82,6 @@ StructDef = | TupleFieldDefList WhereClause? ';' ) -UnionDef = - Attr* Visibility? 'union' Name GenericParamList? WhereClause? - RecordFieldDefList - RecordFieldDefList = '{' fields:RecordFieldDef* '}' @@ -102,6 +98,11 @@ FieldDefList = RecordFieldDefList | TupleFieldDefList + +UnionDef = + Attr* Visibility? 'union' Name GenericParamList? WhereClause? + RecordFieldDefList + EnumDef = Attr* Visibility? 'enum' Name GenericParamList? WhereClause? variant_list:EnumVariantList -- cgit v1.2.3 From 6f8aa75329d0a4e588e58b8f22f7932bf3d3a706 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 16:21:30 +0200 Subject: Rename RecordLit -> RecordExpr --- xtask/src/ast_src.rs | 6 +++--- xtask/src/codegen/rust.ungram | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index b81985851..38709c63e 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -159,9 +159,9 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { "MATCH_ARM_LIST", "MATCH_ARM", "MATCH_GUARD", - "RECORD_LIT", - "RECORD_FIELD_LIST", - "RECORD_FIELD", + "RECORD_EXPR", + "RECORD_EXPR_FIELD_LIST", + "RECORD_EXPR_FIELD", "EFFECT_EXPR", "BOX_EXPR", // postfix diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 7f3063efb..49b2c9ff8 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -285,16 +285,16 @@ MatchArm = MatchGuard = 'if' Expr -RecordLit = - Path RecordFieldList +RecordExpr = + Path RecordExprFieldList -RecordFieldList = +RecordExprFieldList = '{' - fields:RecordField* + fields:RecordExprField* ('..' spread:Expr)? '}' -RecordField = +RecordExprField = Attr* NameRef (':' Expr)? OrPat = @@ -523,7 +523,7 @@ Expr = | BlockExpr | ReturnExpr | MatchExpr -| RecordLit +| RecordExpr | CallExpr | IndexExpr | MethodCallExpr -- cgit v1.2.3