| 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 dart_tree_printer; | 5 library dart_tree_printer; |
| 6 | 6 |
| 7 import '../constants/values.dart' as values; | 7 import '../constants/values.dart' as values; |
| 8 import '../dart_types.dart' as types; | 8 import '../dart_types.dart' as types; |
| 9 import '../dart2jslib.dart' as dart2js; | 9 import '../dart2jslib.dart' as dart2js; |
| 10 import '../elements/elements.dart' as elements; | 10 import '../elements/elements.dart' as elements; |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 makeList(',', stmt.updates.map(makeExpression)), | 768 makeList(',', stmt.updates.map(makeExpression)), |
| 769 makeStatement(stmt.body, shortIf: shortIf), | 769 makeStatement(stmt.body, shortIf: shortIf), |
| 770 forToken); | 770 forToken); |
| 771 } else if (stmt is ForIn) { | 771 } else if (stmt is ForIn) { |
| 772 tree.Node left; | 772 tree.Node left; |
| 773 if (stmt.leftHandValue is Identifier) { | 773 if (stmt.leftHandValue is Identifier) { |
| 774 left = makeExpression(stmt.leftHandValue); | 774 left = makeExpression(stmt.leftHandValue); |
| 775 } else { | 775 } else { |
| 776 left = makeVariableDeclarations(stmt.leftHandValue); | 776 left = makeVariableDeclarations(stmt.leftHandValue); |
| 777 } | 777 } |
| 778 return new tree.SyncForIn( | 778 return new tree.ForIn( |
| 779 left, | 779 left, |
| 780 makeExpression(stmt.expression), | 780 makeExpression(stmt.expression), |
| 781 makeStatement(stmt.body, shortIf: shortIf), | 781 makeStatement(stmt.body, shortIf: shortIf), |
| 782 awaitToken, |
| 782 forToken, | 783 forToken, |
| 783 inToken); | 784 inToken); |
| 784 } else if (stmt is FunctionDeclaration) { | 785 } else if (stmt is FunctionDeclaration) { |
| 785 tree.FunctionExpression function = new tree.FunctionExpression( | 786 tree.FunctionExpression function = new tree.FunctionExpression( |
| 786 stmt.name != null ? makeIdentifier(stmt.name) : null, | 787 stmt.name != null ? makeIdentifier(stmt.name) : null, |
| 787 makeParameters(stmt.parameters), | 788 makeParameters(stmt.parameters), |
| 788 makeFunctionBody(stmt.body), | 789 makeFunctionBody(stmt.body), |
| 789 stmt.returnType != null ? makeType(stmt.returnType) : null, | 790 stmt.returnType != null ? makeType(stmt.returnType) : null, |
| 790 makeEmptyModifiers(), | 791 makeEmptyModifiers(), |
| 791 null, // initializers | 792 null, // initializers |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 printStringChunk(chunk.previous), | 1333 printStringChunk(chunk.previous), |
| 1333 node); | 1334 node); |
| 1334 } else { | 1335 } else { |
| 1335 return node; | 1336 return node; |
| 1336 } | 1337 } |
| 1337 } | 1338 } |
| 1338 return printStringChunk(output.chunk); | 1339 return printStringChunk(output.chunk); |
| 1339 } | 1340 } |
| 1340 | 1341 |
| 1341 } | 1342 } |
| OLD | NEW |