Chromium Code Reviews| 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 final bool printDebugInfo; | 7 final bool printDebugInfo; |
| 8 | 8 |
| 9 Unparser([this.printDebugInfo = false]); | 9 Unparser([this.printDebugInfo = false]); |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 | 70 |
| 71 visitExpressionStatement(ExpressionStatement node) { | 71 visitExpressionStatement(ExpressionStatement node) { |
| 72 visit(node.expression); | 72 visit(node.expression); |
| 73 add(node.endToken.value); | 73 add(node.endToken.value); |
| 74 } | 74 } |
| 75 | 75 |
| 76 visitFor(For node) { | 76 visitFor(For node) { |
| 77 add(node.forToken.value); | 77 add(node.forToken.value); |
| 78 sb.add('('); | 78 sb.add('('); |
| 79 visit(node.initializer); | 79 visit(node.initializer); |
| 80 if (node.initializer is !Statement) sb.add(';'); | |
|
Anton Muhin
2012/06/07 15:40:21
I think it's the best variant.
node.initializer c
| |
| 80 visit(node.conditionStatement); | 81 visit(node.conditionStatement); |
| 81 visit(node.update); | 82 visit(node.update); |
| 82 sb.add(')'); | 83 sb.add(')'); |
| 83 visit(node.body); | 84 visit(node.body); |
| 84 } | 85 } |
| 85 | 86 |
| 86 visitFunctionDeclaration(FunctionDeclaration node) { | 87 visitFunctionDeclaration(FunctionDeclaration node) { |
| 87 visit(node.function); | 88 visit(node.function); |
| 88 } | 89 } |
| 89 | 90 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 sb.add(' '); | 439 sb.add(' '); |
| 439 } | 440 } |
| 440 visit(node.name); | 441 visit(node.name); |
| 441 if (node.typeParameters !== null) { | 442 if (node.typeParameters !== null) { |
| 442 visit(node.typeParameters); | 443 visit(node.typeParameters); |
| 443 } | 444 } |
| 444 visit(node.formals); | 445 visit(node.formals); |
| 445 add(node.endToken.value); | 446 add(node.endToken.value); |
| 446 } | 447 } |
| 447 } | 448 } |
| OLD | NEW |