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

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

Issue 10698092: Fix unparsing of prefix increments. (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/compiler/dart2js/unparser_test.dart » ('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 0e1179b9a28f3b6b0b5a8bee3a3c472a9257e0bb..160890e179a476d2331e605ad765b75ac94161aa 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -224,11 +224,16 @@ class Unparser implements Visitor {
* Special case for assignments like "list[0] = 1".
*/
unparseIndexedSet(SendSet node) {
+ if (node.isPrefix) {
+ add(node.assignmentOperator.token.value);
+ }
visit(node.receiver);
sb.add('[');
sb.add(node.arguments.head);
sb.add(']');
- add(node.assignmentOperator.token.value);
+ if (!node.isPrefix) {
+ add(node.assignmentOperator.token.value);
+ }
unparseNodeListFrom(node.argumentsNode, node.argumentsNode.nodes.tail);
}
@@ -236,8 +241,13 @@ class Unparser implements Visitor {
if (node.isIndex) {
unparseIndexedSet(node);
} else {
+ if (node.isPrefix) {
+ add(node.assignmentOperator.token.value);
+ }
unparseSendPart(node);
- add(node.assignmentOperator.token.value);
+ if (!node.isPrefix) {
+ add(node.assignmentOperator.token.value);
+ }
visit(node.argumentsNode);
}
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698