Chromium Code Reviews| Index: dart/lib/compiler/implementation/scanner/parser.dart |
| diff --git a/dart/lib/compiler/implementation/scanner/parser.dart b/dart/lib/compiler/implementation/scanner/parser.dart |
| index 9e5a9454b32a7723c3c8b70991fe73c24595996e..b0f90b62d4987f8aef940de7fd2a1f46dbb86d5a 100644 |
| --- a/dart/lib/compiler/implementation/scanner/parser.dart |
| +++ b/dart/lib/compiler/implementation/scanner/parser.dart |
| @@ -24,6 +24,7 @@ class Parser { |
| } |
| Token parseTopLevelDeclaration(Token token) { |
| + token = parseMetadataStar(token); |
|
ngeoffray
2012/08/21 06:28:31
What's the Star suffix for? for consistency, shoul
Johnni Winther
2012/08/21 07:05:31
Star means 0 or more. Opt means 0 or 1.
ahe
2012/08/21 07:07:10
The suffix "star" refers to the asterisk in gramma
ahe
2012/08/21 10:49:46
I have updated the class comment.
|
| final String value = token.stringValue; |
| if (value === 'interface') { |
| return parseInterface(token); |
| @@ -38,6 +39,24 @@ class Parser { |
| } |
| } |
| + Token parseMetadataStar(Token token) { |
| + while (optional('@', token)) { |
| + token = parseMetadata(token); |
| + } |
| + return token; |
| + } |
| + |
| + Token parseMetadata(Token token) { |
| + listener.beginMetadata(token); |
| + Token atToken = token; |
| + assert(optional('@', token)); |
| + token = parseIdentifier(token.next); |
| + token = parseQualifiedRestOpt(token); |
| + token = parseArgumentsOpt(token); |
| + listener.endMetadata(atToken, token); |
| + return token; |
| + } |
| + |
| Token parseInterface(Token token) { |
| Token interfaceKeyword = token; |
| listener.beginInterface(token); |
| @@ -586,6 +605,7 @@ class Parser { |
| } |
| Token parseMember(Token token) { |
| + token = parseMetadataStar(token); |
| String value = token.stringValue; |
| if (value === 'factory' || |
| (value === 'external' && optional('factory', token.next))) { |