Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: sdk/lib/_internal/compiler/implementation/scanner/listener.dart

Issue 21511003: Support symbol literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/scanner/listener.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart b/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
index 65f35e28cbcdfe26365afb3c1c1150dc2c988d96..5ee7a0e99fcefaf2070da1436275f8593afe0175 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/listener.dart
@@ -310,6 +310,13 @@ class Listener {
void endSwitchBlock(int caseCount, Token beginToken, Token endToken) {
}
+
+ void beginSymbolLiteral(Token token) {
+ }
+
+ void endSymbolLiteral(Token hashToken, Token operatorToken,
+ int identifierCount) {
+ }
void beginThrowExpression(Token token) {
}
@@ -1326,6 +1333,19 @@ class NodeListener extends ElementListener {
void handleLiteralNull(Token token) {
pushNode(new LiteralNull(token));
}
+
+ void endSymbolLiteral(Token hashToken, Token operatorToken,
+ int identifierCount) {
+ Operator operator = null;
+ if (operatorToken != null) {
+ operator = new Operator(operatorToken);
+ }
+ NodeList identifiers = null;
+ if (identifierCount > 0) {
ahe 2013/08/06 12:20:55 How can identifier count be zero? Is that an error
Johnni Winther 2013/09/03 12:27:50 It meant operatorToken was != null. Both are now i
+ identifiers = makeNodeList(identifierCount, null, null, '.');
+ }
+ pushNode(new SymbolLiteral(hashToken, operator, identifiers));
+ }
void handleBinaryExpression(Token token) {
Node argument = popNode();

Powered by Google App Engine
This is Rietveld 408576698