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

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

Issue 10828093: Properly unparse as operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/unparser.dart
diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
index 2809f0bf43bf4ca5ad84ea86f7980059e6166e41..a78bdd4350e25ca5e83ceef0c246549a26b9d941 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -225,7 +225,8 @@ class Unparser implements Visitor {
unparseSendPart(Send node) {
Operator op = node.selector.asOperator();
- bool isCheck = op !== null && op.source.stringValue === 'is';
+ bool spacesNeeded = op !== null &&
+ (op.source.stringValue === 'is' || op.source.stringValue == 'as');
if (node.isPrefix) {
visit(node.selector);
@@ -237,14 +238,14 @@ class Unparser implements Visitor {
add(asCascadeReceiver.cascadeOperator.value);
} else if (op === null) {
sb.add('.');
- } else if (isCheck) {
+ } else if (spacesNeeded) {
sb.add(' ');
}
}
if (!node.isPrefix && !node.isIndex) {
visit(node.selector);
}
- if (isCheck) {
+ if (spacesNeeded) {
sb.add(' ');
}
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698