| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 visitForIn(ForIn node) { | 300 visitForIn(ForIn node) { |
| 301 add(node.forToken.value); | 301 add(node.forToken.value); |
| 302 sb.add(' ('); | 302 sb.add(' ('); |
| 303 visit(node.declaredIdentifier); | 303 visit(node.declaredIdentifier); |
| 304 add(node.inToken.value); | 304 add(node.inToken.value); |
| 305 visit(node.expression); | 305 visit(node.expression); |
| 306 sb.add(') '); | 306 sb.add(') '); |
| 307 visit(node.body); | 307 visit(node.body); |
| 308 } | 308 } |
| 309 | 309 |
| 310 visitLabel(Label node) { |
| 311 visit(node.identifier); |
| 312 add(node.colonToken.value); |
| 313 } |
| 314 |
| 310 visitLabeledStatement(LabeledStatement node) { | 315 visitLabeledStatement(LabeledStatement node) { |
| 311 visit(node.label); | 316 visit(node.label); |
| 312 add(node.colonToken.value); | |
| 313 sb.add(' '); | 317 sb.add(' '); |
| 314 visit(node.statement); | 318 visit(node.statement); |
| 315 } | 319 } |
| 316 | 320 |
| 317 visitLiteralMap(LiteralMap node) { | 321 visitLiteralMap(LiteralMap node) { |
| 318 // TODO(ahe): handle 'const'. | 322 // TODO(ahe): handle 'const'. |
| 319 if (node.typeArguments !== null) visit(node.typeArguments); | 323 if (node.typeArguments !== null) visit(node.typeArguments); |
| 320 visit(node.entries); | 324 visit(node.entries); |
| 321 } | 325 } |
| 322 | 326 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 sb.add(' '); | 405 sb.add(' '); |
| 402 } | 406 } |
| 403 visit(node.name); | 407 visit(node.name); |
| 404 if (node.typeParameters !== null) { | 408 if (node.typeParameters !== null) { |
| 405 visit(node.typeParameters); | 409 visit(node.typeParameters); |
| 406 } | 410 } |
| 407 visit(node.formals); | 411 visit(node.formals); |
| 408 add(node.endToken.value); | 412 add(node.endToken.value); |
| 409 } | 413 } |
| 410 } | 414 } |
| OLD | NEW |