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

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

Issue 278823002: dart2dart: Method and constructor calls in new backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed call to addArgumentsToList. Created 6 years, 7 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 | « sdk/lib/_internal/compiler/implementation/ir/ir_unpickler.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 88fa1d7ef115a89f4f08e0607a80b4b10f1edfe8..632741ccd22fdd9a492d18186f9b6c07a56e5d4c 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/unparser.dart
@@ -301,14 +301,21 @@ class Unparser implements Visitor {
String opString = op != null ? op.source : null;
bool spacesNeeded = identical(opString, 'is') || identical(opString, 'as');
- if (node.isPrefix) visit(node.selector);
+ if (node.isPrefix) {
+ visit(node.selector);
+ // Add a space for sequences like - -x (double unary minus).
+ if (identical(opString, '-')) {
+ Token beginToken = node.receiver.getBeginToken();
+ if (identical(beginToken.stringValue, opString)) {
+ sb.write(' ');
+ }
+ }
+ }
unparseSendReceiver(node, spacesNeeded: spacesNeeded);
if (!node.isPrefix && !node.isIndex) visit(node.selector);
if (spacesNeeded) sb.write(' ');
- // Also add a space for sequences like x + +1 and y - -y.
- // TODO(ahe): remove case for '+' when we drop the support for it.
- if (node.argumentsNode != null && (identical(opString, '-')
- || identical(opString, '+'))) {
+ // Also add a space for sequences like y - -y.
+ if (node.argumentsNode != null && identical(opString, '-')) {
Token beginToken = node.argumentsNode.getBeginToken();
if (beginToken != null && identical(beginToken.stringValue, opString)) {
sb.write(' ');
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ir/ir_unpickler.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698