| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 visit(node.first); | 123 visit(node.first); |
| 124 sb.add(" "); | 124 sb.add(" "); |
| 125 visit(node.second); | 125 visit(node.second); |
| 126 } | 126 } |
| 127 | 127 |
| 128 visitLiteralNull(LiteralNull node) { | 128 visitLiteralNull(LiteralNull node) { |
| 129 add(node.token.value); | 129 add(node.token.value); |
| 130 } | 130 } |
| 131 | 131 |
| 132 visitNewExpression(NewExpression node) { | 132 visitNewExpression(NewExpression node) { |
| 133 // TODO(ahe): handle 'const'. |
| 133 add(node.newToken.value); | 134 add(node.newToken.value); |
| 134 sb.add(' '); | 135 sb.add(' '); |
| 135 visit(node.send); | 136 visit(node.send); |
| 136 } | 137 } |
| 137 | 138 |
| 138 visitLiteralList(LiteralList node) { | 139 visitLiteralList(LiteralList node) { |
| 140 // TODO(ahe): handle 'const'. |
| 139 if (node.type !== null) { | 141 if (node.type !== null) { |
| 140 sb.add('<'); | 142 sb.add('<'); |
| 141 visit(node.type); | 143 visit(node.type); |
| 142 sb.add('>'); | 144 sb.add('>'); |
| 143 } | 145 } |
| 144 sb.add(' '); | 146 sb.add(' '); |
| 145 visit(node.elements); | 147 visit(node.elements); |
| 146 } | 148 } |
| 147 | 149 |
| 148 visitModifiers(Modifiers node) => node.visitChildren(this); | 150 visitModifiers(Modifiers node) => node.visitChildren(this); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 300 } |
| 299 | 301 |
| 300 visitLabeledStatement(LabeledStatement node) { | 302 visitLabeledStatement(LabeledStatement node) { |
| 301 visit(node.label); | 303 visit(node.label); |
| 302 add(node.colonToken.value); | 304 add(node.colonToken.value); |
| 303 sb.add(' '); | 305 sb.add(' '); |
| 304 visit(node.statement); | 306 visit(node.statement); |
| 305 } | 307 } |
| 306 | 308 |
| 307 visitLiteralMap(LiteralMap node) { | 309 visitLiteralMap(LiteralMap node) { |
| 310 // TODO(ahe): handle 'const'. |
| 308 if (node.typeArguments !== null) visit(node.typeArguments); | 311 if (node.typeArguments !== null) visit(node.typeArguments); |
| 309 visit(node.entries); | 312 visit(node.entries); |
| 310 } | 313 } |
| 311 | 314 |
| 312 visitLiteralMapEntry(LiteralMapEntry node) { | 315 visitLiteralMapEntry(LiteralMapEntry node) { |
| 313 visit(node.key); | 316 visit(node.key); |
| 314 add(node.colonToken.value); | 317 add(node.colonToken.value); |
| 315 sb.add(' '); | 318 sb.add(' '); |
| 316 visit(node.value); | 319 visit(node.value); |
| 317 } | 320 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 sb.add(' '); | 393 sb.add(' '); |
| 391 } | 394 } |
| 392 visit(node.name); | 395 visit(node.name); |
| 393 if (node.typeParameters !== null) { | 396 if (node.typeParameters !== null) { |
| 394 visit(node.typeParameters); | 397 visit(node.typeParameters); |
| 395 } | 398 } |
| 396 visit(node.formals); | 399 visit(node.formals); |
| 397 add(node.endToken.value); | 400 add(node.endToken.value); |
| 398 } | 401 } |
| 399 } | 402 } |
| OLD | NEW |