| 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 14 matching lines...) Expand all Loading... |
| 25 if (printDebugInfo) sb.add(']'); | 25 if (printDebugInfo) sb.add(']'); |
| 26 } else if (printDebugInfo) { | 26 } else if (printDebugInfo) { |
| 27 sb.add('[null]'); | 27 sb.add('[null]'); |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 | 30 |
| 31 visitBlock(Block node) { | 31 visitBlock(Block node) { |
| 32 visit(node.statements); | 32 visit(node.statements); |
| 33 } | 33 } |
| 34 | 34 |
| 35 visitCascade(Cascade node) { |
| 36 visit(node.expression); |
| 37 } |
| 38 |
| 39 visitCascadeReceiver(CascadeReceiver node) { |
| 40 visit(node.expression); |
| 41 } |
| 42 |
| 35 visitClassNode(ClassNode node) { | 43 visitClassNode(ClassNode node) { |
| 36 node.beginToken.value.printOn(sb); | 44 node.beginToken.value.printOn(sb); |
| 37 sb.add(' '); | 45 sb.add(' '); |
| 38 visit(node.name); | 46 visit(node.name); |
| 39 sb.add(' '); | 47 sb.add(' '); |
| 40 if (node.extendsKeyword !== null) { | 48 if (node.extendsKeyword !== null) { |
| 41 node.extendsKeyword.value.printOn(sb); | 49 node.extendsKeyword.value.printOn(sb); |
| 42 sb.add(' '); | 50 sb.add(' '); |
| 43 visit(node.superclass); | 51 visit(node.superclass); |
| 44 sb.add(' '); | 52 sb.add(' '); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 sb.add(' '); | 401 sb.add(' '); |
| 394 } | 402 } |
| 395 visit(node.name); | 403 visit(node.name); |
| 396 if (node.typeParameters !== null) { | 404 if (node.typeParameters !== null) { |
| 397 visit(node.typeParameters); | 405 visit(node.typeParameters); |
| 398 } | 406 } |
| 399 visit(node.formals); | 407 visit(node.formals); |
| 400 add(node.endToken.value); | 408 add(node.endToken.value); |
| 401 } | 409 } |
| 402 } | 410 } |
| OLD | NEW |