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 ee84b4c57e6afc1cabc217f1b25c259f19d1e1d0..6488956f928f5ed9070fad7a3083dcac1ecdce5f 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/scanner/parser.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/scanner/parser.dart |
| @@ -1483,6 +1483,8 @@ class Parser { |
| return parseLiteralDouble(token); |
| } else if (identical(kind, STRING_TOKEN)) { |
| return parseLiteralString(token); |
| + } else if (identical(kind, HASH_TOKEN)) { |
| + return parseSymbolLiteral(token); |
| } else if (identical(kind, KEYWORD_TOKEN)) { |
| final value = token.stringValue; |
| if ((identical(value, 'true')) || (identical(value, 'false'))) { |
| @@ -1703,6 +1705,26 @@ class Parser { |
| return token; |
| } |
| + Token parseSymbolLiteral(Token token) { |
| + Token hashToken = token; |
| + listener.beginSymbolLiteral(hashToken); |
| + token = token.next; |
| + if (isUserDefinableOperator(token.stringValue)) { |
| + listener.endSymbolLiteral(hashToken, token, 0); |
| + return token.next; |
| + } else { |
| + int count = 1; |
| + token = parseIdentifier(token); |
|
ahe
2013/08/06 12:20:55
Can you use parseQualified?
Johnni Winther
2013/09/03 12:27:50
No. Then I will get one Send instead of a NodeList
|
| + while (identical(token.stringValue, '.')) { |
| + count++; |
| + token = parseIdentifier(token.next); |
| + } |
| + listener.endSymbolLiteral(hashToken, null, count); |
| + return token; |
| + } |
| + } |
| + |
| + |
|
ahe
2013/08/06 12:20:55
Extra line.
Johnni Winther
2013/09/03 12:27:50
Done.
|
| /** |
| * Only called when [:token.kind === STRING_TOKEN:]. |
| */ |