Chromium Code Reviews| Index: frog/gen.dart |
| =================================================================== |
| --- frog/gen.dart (revision 2468) |
| +++ frog/gen.dart (working copy) |
| @@ -1870,9 +1870,17 @@ |
| return; |
| } |
| return x.invoke(this, name, node, new Arguments(null, [y])); |
| - } else { |
| - return _visitAssign(assignKind, node.x, node.y, node, null, isVoid); |
| - } |
| + } else if ((assignKind != 0) && (node.y is BinaryExpression)){ |
| + BinaryExpression y = node.y; |
| + if (TokenKind.infixPrecedence(y.op.kind) <= |
| + TokenKind.infixPrecedence(assignKind)) { |
|
jimhug
2011/12/15 17:43:18
I would prefer not to include this check. My gene
dgrove
2011/12/15 17:51:45
It doesn't any changes in minfrog, for instance. I
dgrove
2011/12/15 17:51:45
Done.
|
| + // This handles transforming A x= B y C => A = A x (B y C) when |
| + // precedence of x >= precedence of y. |
| + return _visitAssign(assignKind, node.x, |
| + new ParenExpression(node.y, node.y.span), node, null, isVoid); |
| + } |
| + } |
| + return _visitAssign(assignKind, node.x, node.y, node, null, isVoid); |
| } |
| /** |