| Index: pkg/analyzer/lib/src/generated/parser.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
|
| index 2d94dd0aafff19c4dd7c3edb1a9a053e390a6b6e..3787d756636318153da51c7b98d43558ed379b59 100644
|
| --- a/pkg/analyzer/lib/src/generated/parser.dart
|
| +++ b/pkg/analyzer/lib/src/generated/parser.dart
|
| @@ -6084,6 +6084,9 @@ class Parser {
|
| } else {
|
| name = _createSyntheticIdentifier();
|
| }
|
| + if (commentAndMetadata.metadata.isNotEmpty) {
|
| + _reportErrorForNode(ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT, commentAndMetadata.metadata[0]);
|
| + }
|
| return new EnumConstantDeclaration(
|
| commentAndMetadata.comment,
|
| commentAndMetadata.metadata,
|
| @@ -6110,7 +6113,7 @@ class Parser {
|
| Token rightBracket = null;
|
| if (_matches(TokenType.OPEN_CURLY_BRACKET)) {
|
| leftBracket = _expect(TokenType.OPEN_CURLY_BRACKET);
|
| - if (_matchesIdentifier()) {
|
| + if (_matchesIdentifier() || _matches(TokenType.AT)) {
|
| constants.add(_parseEnumConstantDeclaration());
|
| } else if (_matches(TokenType.COMMA) &&
|
| _tokenMatchesIdentifier(_peek())) {
|
| @@ -10015,6 +10018,10 @@ class ParserErrorCode extends ErrorCode {
|
| 'ABSTRACT_TYPEDEF',
|
| "Type aliases cannot be declared to be 'abstract'");
|
|
|
| + static const ParserErrorCode ANNOTATION_ON_ENUM_CONSTANT = const ParserErrorCode(
|
| + 'ANNOTATION_ON_ENUM_CONSTANT',
|
| + "Enum constants cannot have annotations");
|
| +
|
| static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT =
|
| const ParserErrorCode(
|
| 'ASSERT_DOES_NOT_TAKE_ASSIGNMENT',
|
|
|