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

Unified Diff: dart/frog/leg/tree/nodes.dart

Issue 8993009: Implement string interpolation up to SSA. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address (some) review comments and update status file Created 9 years 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
« no previous file with comments | « dart/frog/leg/tools/mini_parser.dart ('k') | dart/frog/leg/tree/unparser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/tree/nodes.dart
diff --git a/dart/frog/leg/tree/nodes.dart b/dart/frog/leg/tree/nodes.dart
index e6ea83854aa9cb22be782693aaa2571068654c12..2a62457aa4299ae6f4f1227a219d75d9d3ea7a16 100644
--- a/dart/frog/leg/tree/nodes.dart
+++ b/dart/frog/leg/tree/nodes.dart
@@ -26,6 +26,8 @@ interface Visitor<R> {
R visitReturn(Return node);
R visitSend(Send node);
R visitSendSet(SendSet node);
+ R visitStringInterpolation(StringInterpolation node);
+ R visitStringInterpolationPart(StringInterpolationPart node);
R visitThrow(Throw node);
R visitTypeAnnotation(TypeAnnotation node);
R visitVariableDefinitions(VariableDefinitions node);
@@ -99,6 +101,8 @@ class Node implements Hashable {
Return asReturn() => null;
Send asSend() => null;
SendSet asSendSet() => null;
+ StringInterpolation asStringInterpolation() => null;
+ StringInterpolationPart asStringInterpolationPart() => null;
Throw asThrow() => null;
TypeAnnotation asTypeAnnotation() => null;
VariableDefinitions asVariableDefinitions() => null;
@@ -826,6 +830,46 @@ class Modifiers extends Node {
bool isConst() => (flags & FLAG_CONST) != 0;
}
+class StringInterpolation extends Expression {
+ final LiteralString string;
+ final NodeList parts;
+
+ StringInterpolation(this.string, this.parts);
+
+ StringInterpolation asStringInterpolation() => this;
+
+ accept(Visitor visitor) => visitor.visitStringInterpolation(this);
+
+ visitChildren(Visitor visitor) {
+ string.accept(visitor);
+ parts.accept(visitor);
+ }
+
+ Token getBeginToken() => string.getBeginToken();
+
+ Token getEndToken() => parts.getEndToken();
+}
+
+class StringInterpolationPart extends Node {
+ final Expression expression;
+ final LiteralString string;
+
+ StringInterpolationPart(this.expression, this.string);
+
+ StringInterpolationPart asStringInterpolationPart() => this;
+
+ accept(Visitor visitor) => visitor.visitStringInterpolationPart(this);
+
+ visitChildren(Visitor visitor) {
+ expression.accept(visitor);
+ string.accept(visitor);
+ }
+
+ Token getBeginToken() => expression.getBeginToken();
+
+ Token getEndToken() => string.getEndToken();
+}
+
class UnimplementedExpression extends Expression {
final String description;
final NodeList nodes;
« no previous file with comments | « dart/frog/leg/tools/mini_parser.dart ('k') | dart/frog/leg/tree/unparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698