| 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 class Unparser implements Visitor { | 5 class Unparser implements Visitor { |
| 6 StringBuffer sb; | 6 StringBuffer sb; |
| 7 | 7 |
| 8 Unparser(); | 8 Unparser(); |
| 9 | 9 |
| 10 String unparse(Node node) { | 10 String unparse(Node node) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 visitExpressionStatement(ExpressionStatement node) { | 64 visitExpressionStatement(ExpressionStatement node) { |
| 65 visit(node.expression); | 65 visit(node.expression); |
| 66 add(node.endToken.value); | 66 add(node.endToken.value); |
| 67 } | 67 } |
| 68 | 68 |
| 69 visitFor(For node) { | 69 visitFor(For node) { |
| 70 add(node.forToken.value); | 70 add(node.forToken.value); |
| 71 sb.add('('); | 71 sb.add('('); |
| 72 visit(node.initializer); | 72 visit(node.initializer); |
| 73 if (node.initializer is !Statement) sb.add(';'); |
| 73 visit(node.conditionStatement); | 74 visit(node.conditionStatement); |
| 74 visit(node.update); | 75 visit(node.update); |
| 75 sb.add(')'); | 76 sb.add(')'); |
| 76 visit(node.body); | 77 visit(node.body); |
| 77 } | 78 } |
| 78 | 79 |
| 79 visitFunctionDeclaration(FunctionDeclaration node) { | 80 visitFunctionDeclaration(FunctionDeclaration node) { |
| 80 visit(node.function); | 81 visit(node.function); |
| 81 } | 82 } |
| 82 | 83 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 sb.add(' '); | 432 sb.add(' '); |
| 432 } | 433 } |
| 433 visit(node.name); | 434 visit(node.name); |
| 434 if (node.typeParameters !== null) { | 435 if (node.typeParameters !== null) { |
| 435 visit(node.typeParameters); | 436 visit(node.typeParameters); |
| 436 } | 437 } |
| 437 visit(node.formals); | 438 visit(node.formals); |
| 438 add(node.endToken.value); | 439 add(node.endToken.value); |
| 439 } | 440 } |
| 440 } | 441 } |
| OLD | NEW |