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

Unified Diff: sdk/lib/_internal/compiler/implementation/tree/nodes.dart

Issue 21511003: Support symbol literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 3 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/tree/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
index 210ebe52563b6e17541b614e1c3b0ff8372c1f57..372b4ae5088c5b0e20d87042a7a54be3684b4d5a 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
@@ -76,6 +76,7 @@ abstract class Visitor<R> {
}
R visitSwitchCase(SwitchCase node) => visitNode(node);
R visitSwitchStatement(SwitchStatement node) => visitStatement(node);
+ R visitLiteralSymbol(LiteralSymbol node) => visitExpression(node);
R visitThrow(Throw node) => visitExpression(node);
R visitTryStatement(TryStatement node) => visitStatement(node);
R visitTypeAnnotation(TypeAnnotation node) => visitNode(node);
@@ -947,6 +948,27 @@ class LiteralList extends Expression {
Token getEndToken() => elements.getEndToken();
}
+class LiteralSymbol extends Expression {
+ final Token hashToken;
+ final NodeList identifiers;
+
+ LiteralSymbol(this.hashToken, this.identifiers);
+
+ LiteralSymbol asLiteralSymbol() => this;
+
+ void visitChildren(Visitor visitor) {
+ if (identifiers != null) identifiers.accept(visitor);
+ }
+
+ accept(Visitor visitor) => visitor.visitLiteralSymbol(this);
+
+ Token getBeginToken() => hashToken;
+
+ Token getEndToken() => identifiers.getEndToken();
+
+ String get slowNameString => '${identifiers}';
+}
+
class Identifier extends Expression {
final Token token;

Powered by Google App Engine
This is Rietveld 408576698