| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library logical_rewriter; | 5 library logical_rewriter; |
| 6 | 6 |
| 7 import '../constants/values.dart' as values; | 7 import '../constants/values.dart' as values; |
| 8 import 'tree_ir_nodes.dart'; | 8 import '../tree_ir/tree_ir_nodes.dart'; |
| 9 | 9 |
| 10 /// Rewrites logical expressions to be more compact in the Tree IR. | 10 /// Rewrites logical expressions to be more compact in the Tree IR. |
| 11 /// | 11 /// |
| 12 /// In this class an expression is said to occur in "boolean context" if | 12 /// In this class an expression is said to occur in "boolean context" if |
| 13 /// its result is immediately applied to boolean conversion. | 13 /// its result is immediately applied to boolean conversion. |
| 14 /// | 14 /// |
| 15 /// IF STATEMENTS: | 15 /// IF STATEMENTS: |
| 16 /// | 16 /// |
| 17 /// We apply the following two rules to [If] statements (see [visitIf]). | 17 /// We apply the following two rules to [If] statements (see [visitIf]). |
| 18 /// | 18 /// |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } | 444 } |
| 445 | 445 |
| 446 /// Destructively updates each entry of [l] with the result of visiting it. | 446 /// Destructively updates each entry of [l] with the result of visiting it. |
| 447 void _rewriteList(List<Expression> l) { | 447 void _rewriteList(List<Expression> l) { |
| 448 for (int i = 0; i < l.length; i++) { | 448 for (int i = 0; i < l.length; i++) { |
| 449 l[i] = visitExpression(l[i]); | 449 l[i] = visitExpression(l[i]); |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 | 453 |
| OLD | NEW |