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

Unified Diff: pkg/compiler/lib/src/tree/unparser.dart

Issue 880973005: Support async/await in dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment + status for new_backend Created 5 years, 11 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: pkg/compiler/lib/src/tree/unparser.dart
diff --git a/pkg/compiler/lib/src/tree/unparser.dart b/pkg/compiler/lib/src/tree/unparser.dart
index 3ac6a9b6f5c3e7067885151a2ed8ee42604a0c2a..1d9c690249c54bf862c47be260d433e4db8f8fed 100644
--- a/pkg/compiler/lib/src/tree/unparser.dart
+++ b/pkg/compiler/lib/src/tree/unparser.dart
@@ -253,8 +253,18 @@ 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();
+ if (node.asyncModifier != null) {
+ if (node.getOrSet != null) {
+ write(' ');
+ } else {
+ // Space is optional if this is not a getter.
+ space();
+ }
+ visit(node.asyncModifier);
+ }
+ if (node.body != null && node.body is! EmptyStatement) {
+ space();
+ }
visit(node.body);
}
@@ -394,11 +404,13 @@ class Unparser extends Indentation implements Visitor {
}
visitYield(Yield node) {
- write(node.yieldToken);
- write(node.starToken);
+ write(node.yieldToken.value);
+ if (node.starToken != null) {
+ write(node.starToken.value);
+ }
space();
visit(node.expression);
- write(node.endToken);
+ write(node.endToken.value);
}

Powered by Google App Engine
This is Rietveld 408576698