| Index: sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| index 33fbfeb982fc34067e43f7b5438407afd48eea68..8705beca98ba7112851381e7426141f18648b26a 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart
|
| @@ -62,6 +62,8 @@ class Parser {
|
| if ((identical(value, 'abstract') && optional('class', token.next))
|
| || identical(value, 'class')) {
|
| return parseClassOrNamedMixinApplication(token);
|
| + } else if (identical(value, 'enum')) {
|
| + return parseEnum(token);
|
| } else if (identical(value, 'typedef')) {
|
| return parseTypedef(token);
|
| } else if (identical(value, 'library')) {
|
| @@ -454,6 +456,28 @@ class Parser {
|
| return beginGroupToken.endGroup;
|
| }
|
|
|
| + Token parseEnum(Token token) {
|
| + listener.beginEnum(token);
|
| + Token enumKeyword = token;
|
| + token = parseIdentifier(token.next);
|
| + token = expect('{', token);
|
| + int count = 0;
|
| + if (!optional('}', token)) {
|
| + token = parseIdentifier(token);
|
| + count++;
|
| + while (optional(',', token)) {
|
| + token = token.next;
|
| + if (optional('}', token)) break;
|
| + token = parseIdentifier(token);
|
| + count++;
|
| + }
|
| + }
|
| + Token endBrace = token;
|
| + token = expect('}', token);
|
| + listener.endEnum(enumKeyword, endBrace, count);
|
| + return token;
|
| + }
|
| +
|
| Token parseClassOrNamedMixinApplication(Token token) {
|
| Token begin = token;
|
| Token abstractKeyword;
|
|
|