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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart

Issue 295933006: dart2dart: Introduce compound assignment and prefix increment in dart_codegen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: SVN rebase 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
Index: sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
index b4069ecb384d9b8eb8bd949e19d36134cb3db806..1ae677799334aeb308db92a934739ee2cc379d81 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
@@ -268,18 +268,18 @@ class TreePrinter {
} else {
throw "Unexpected left-hand side of assignment: ${left}";
}
- tree.Operator op = new tree.Operator(assignmentToken(exp.operatorName));
+ tree.Operator op = new tree.Operator(assignmentToken(exp.operator));
result = new tree.SendSet(receiver, selector, op, arguments);
if (left is Identifier) {
setElement(result, element, exp);
}
precedence = EXPRESSION;
} else if (exp is BinaryOperator) {
- precedence = BINARY_PRECEDENCE[exp.operatorName];
+ precedence = BINARY_PRECEDENCE[exp.operator];
int deltaLeft = isAssociativeBinaryOperator(precedence) ? 0 : 1;
result = new tree.Send(
makeExp(exp.left, precedence + deltaLeft, beginStmt: beginStmt),
- new tree.Operator(binopToken(exp.operatorName)),
+ new tree.Operator(binopToken(exp.operator)),
singleton(makeExp(exp.right, precedence + 1)));
} else if (exp is CallFunction) {
precedence = CALLEE;
@@ -384,7 +384,7 @@ class TreePrinter {
} else {
throw "Unrecognized left-hand side: ${lvalue}";
}
- tree.Operator op = new tree.Operator(incrementToken(exp.operatorName));
+ tree.Operator op = new tree.Operator(incrementToken(exp.operator));
if (exp.isPrefix) {
precedence = UNARY;
result = new tree.SendSet.prefix(receiver, selector, op, argument);
@@ -392,6 +392,9 @@ class TreePrinter {
precedence = POSTFIX_INCREMENT;
result = new tree.SendSet.postfix(receiver, selector, op, argument);
}
+ if (lvalue is Identifier) {
+ setElement(result, lvalue.element, exp);
+ }
} else if (exp is IndexExpression) {
precedence = CALLEE;
result = new tree.Send(
@@ -470,14 +473,14 @@ class TreePrinter {
precedence = RELATIONAL;
tree.Operator operator;
tree.Node rightOperand = makeType(exp.type);
- if (exp.operatorName == 'is!') {
+ if (exp.operator == 'is!') {
operator = new tree.Operator(typeOpToken('is'));
rightOperand = new tree.Send(
rightOperand,
new tree.Operator(bang),
blankList());
} else {
- operator = new tree.Operator(typeOpToken(exp.operatorName));
+ operator = new tree.Operator(typeOpToken(exp.operator));
}
result = new tree.Send(
makeExp(exp.expression, BITWISE_OR, beginStmt: beginStmt),

Powered by Google App Engine
This is Rietveld 408576698