Chromium Code Reviews| 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 34d0d653cf77319c2117a5bd84fbc13b152450e8..9ee6c82c9c6c432c299a06490871340c20f45de2 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,26 @@ class Parser { |
| return beginGroupToken.endGroup; |
| } |
| + Token parseEnum(Token token) { |
|
ahe
2014/05/12 11:24:03
This looks reasonable.
I think this fails to pars
|
| + 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 = expect(',', token); |
| + token = parseIdentifier(token); |
| + count++; |
| + } |
| + } |
| + Token endBrace = token; |
| + listener.endEnum(enumKeyword, endBrace, count); |
| + return token.next; |
| + } |
| + |
| Token parseClassOrNamedMixinApplication(Token token) { |
| Token begin = token; |
| Token abstractKeyword; |