| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 String unparse(Node node) { | 7 String unparse(Node node) { |
| 8 Unparser unparser = new Unparser(); | 8 Unparser unparser = new Unparser(); |
| 9 unparser.unparse(node); | 9 unparser.unparse(node); |
| 10 return unparser.result; | 10 return unparser.result; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 visitVariableDefinitions(VariableDefinitions node) { | 359 visitVariableDefinitions(VariableDefinitions node) { |
| 360 visit(node.modifiers); | 360 visit(node.modifiers); |
| 361 if (!node.modifiers.nodes.isEmpty) { | 361 if (!node.modifiers.nodes.isEmpty) { |
| 362 sb.add(' '); | 362 sb.add(' '); |
| 363 } | 363 } |
| 364 if (node.type != null) { | 364 if (node.type != null) { |
| 365 visit(node.type); | 365 visit(node.type); |
| 366 sb.add(' '); | 366 sb.add(' '); |
| 367 } | 367 } |
| 368 visit(node.definitions); | 368 visit(node.definitions); |
| 369 if (node.endToken.value == const SourceString(';')) { |
| 370 add(node.endToken.value); |
| 371 } |
| 369 } | 372 } |
| 370 | 373 |
| 371 visitDoWhile(DoWhile node) { | 374 visitDoWhile(DoWhile node) { |
| 372 add(node.doKeyword.value); | 375 add(node.doKeyword.value); |
| 373 if (node.body is !Block) sb.add(' '); | 376 if (node.body is !Block) sb.add(' '); |
| 374 visit(node.body); | 377 visit(node.body); |
| 375 add(node.whileKeyword.value); | 378 add(node.whileKeyword.value); |
| 376 visit(node.condition); | 379 visit(node.condition); |
| 377 sb.add(node.endToken.value); | 380 sb.add(node.endToken.value); |
| 378 } | 381 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 } | 621 } |
| 619 | 622 |
| 620 visitStatement(Statement node) { | 623 visitStatement(Statement node) { |
| 621 throw 'internal error'; // Should not be called. | 624 throw 'internal error'; // Should not be called. |
| 622 } | 625 } |
| 623 | 626 |
| 624 visitStringNode(StringNode node) { | 627 visitStringNode(StringNode node) { |
| 625 throw 'internal error'; // Should not be called. | 628 throw 'internal error'; // Should not be called. |
| 626 } | 629 } |
| 627 } | 630 } |
| OLD | NEW |