| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 visitIdentifier(Identifier node) { | 100 visitIdentifier(Identifier node) { |
| 101 add(node.token.value); | 101 add(node.token.value); |
| 102 } | 102 } |
| 103 | 103 |
| 104 visitIf(If node) { | 104 visitIf(If node) { |
| 105 add(node.ifToken.value); | 105 add(node.ifToken.value); |
| 106 visit(node.condition); | 106 visit(node.condition); |
| 107 visit(node.thenPart); | 107 visit(node.thenPart); |
| 108 if (node.hasElsePart) { | 108 if (node.hasElsePart) { |
| 109 add(node.elseToken.value); | 109 add(node.elseToken.value); |
| 110 sb.add(' '); |
| 110 visit(node.elsePart); | 111 visit(node.elsePart); |
| 111 } | 112 } |
| 112 } | 113 } |
| 113 | 114 |
| 114 visitLiteralBool(LiteralBool node) { | 115 visitLiteralBool(LiteralBool node) { |
| 115 add(node.token.value); | 116 add(node.token.value); |
| 116 } | 117 } |
| 117 | 118 |
| 118 visitLiteralDouble(LiteralDouble node) { | 119 visitLiteralDouble(LiteralDouble node) { |
| 119 add(node.token.value); | 120 add(node.token.value); |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 sb.add(' '); | 436 sb.add(' '); |
| 436 } | 437 } |
| 437 visit(node.name); | 438 visit(node.name); |
| 438 if (node.typeParameters !== null) { | 439 if (node.typeParameters !== null) { |
| 439 visit(node.typeParameters); | 440 visit(node.typeParameters); |
| 440 } | 441 } |
| 441 visit(node.formals); | 442 visit(node.formals); |
| 442 add(node.endToken.value); | 443 add(node.endToken.value); |
| 443 } | 444 } |
| 444 } | 445 } |
| OLD | NEW |