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

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

Issue 675113002: Support async/await in the dart2js frontend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 6 years, 1 month 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/unparser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
index 288b31a8f26771466b4933141f38f78dae896d55..b4ce89d0e0e2d87bc22dd965363e1d85bd6bcaf9 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
@@ -217,6 +217,13 @@ class Unparser extends Indentation implements Visitor {
}
}
+ visitAsyncModifier(AsyncModifier node) {
+ write(node.asyncToken.value);
+ if (node.starToken != null) {
+ write(node.starToken.value);
+ }
+ }
+
visitFunctionExpression(FunctionExpression node) {
if (!node.modifiers.nodes.isEmpty) {
visit(node.modifiers);
@@ -239,6 +246,7 @@ class Unparser extends Indentation implements Visitor {
unparseNodeListFrom(node.initializers, node.initializers.nodes,
spaces: true);
}
+ visit(node.asyncModifier);
if (node.body != null && node.body is! EmptyStatement) space();
visit(node.body);
}
@@ -378,6 +386,15 @@ class Unparser extends Indentation implements Visitor {
if (node.endToken != null) write(node.endToken.value);
}
+ visitYield(Yield node) {
+ write(node.yieldToken);
+ write(node.starToken);
+ space();
+ visit(node.expression);
+ write(node.endToken);
+ }
+
+
unparseSendReceiver(Send node, {bool spacesNeeded: false}) {
if (node.receiver == null) return;
visit(node.receiver);
@@ -488,6 +505,12 @@ class Unparser extends Indentation implements Visitor {
visit(node.expression);
}
+ visitAwait(Await node) {
+ write(node.awaitToken.value);
+ write(' ');
+ visit(node.expression);
+ }
+
visitTypeAnnotation(TypeAnnotation node) {
visit(node.typeName);
visit(node.typeArguments);
@@ -582,6 +605,10 @@ class Unparser extends Indentation implements Visitor {
}
visitForIn(ForIn node) {
+ if (node.awaitToken != null) {
+ write(node.awaitToken.value);
+ write(' ');
+ }
write(node.forToken.value);
space();
write('(');

Powered by Google App Engine
This is Rietveld 408576698