From 1c13f49159bd0a9fd72552197121319024b61136 Mon Sep 17 00:00:00 2001 From: Erik Ernst Date: Mon, 11 Oct 2021 14:08:55 +0000 Subject: [PATCH] Add enhanced enums support to Dart.g Change-Id: Ie9b93497491dd44576f6e0e8c58499f98e7a74df Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216021 Commit-Queue: Erik Ernst Reviewed-by: Lasse R.H. Nielsen --- tools/spec_parser/Dart.g | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/spec_parser/Dart.g b/tools/spec_parser/Dart.g index 465b18a85fc..e9927112fc4 100644 --- a/tools/spec_parser/Dart.g +++ b/tools/spec_parser/Dart.g @@ -4,7 +4,10 @@ // CHANGES: // -// v0.17 Correct `uri` to allow multi-line strings (raw and non-raw). +// v0.18 Add support for enhanced `enum` declarations. +// +// v0.17 (58d917e7573c359580ade43845004dbbc62220d5) Correct `uri` to allow +// multi-line strings (raw and non-raw). // // v0.16 (284695f1937c262523a9a11b9084213f889c83e0) Correct instance variable // declaration syntax such that `covariant late final` is allowed. @@ -484,11 +487,15 @@ mixinApplication ; enumType - : ENUM typeIdentifier LBRACE enumEntry (',' enumEntry)* (',')? RBRACE + : ENUM typeIdentifier typeParameters? mixins? interfaces? LBRACE + enumEntry (',' enumEntry)* (',')? + (';' (metadata classMemberDefinition)*)? + RBRACE ; enumEntry - : metadata identifier + : metadata identifier argumentPart? + | metadata identifier typeArguments? '.' identifier arguments ; typeParameter