| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 | 113 |
| 114 visitLiteralInt(LiteralInt node) { | 114 visitLiteralInt(LiteralInt node) { |
| 115 add(node.token.value); | 115 add(node.token.value); |
| 116 } | 116 } |
| 117 | 117 |
| 118 visitLiteralString(LiteralString node) { | 118 visitLiteralString(LiteralString node) { |
| 119 add(node.token.value); | 119 add(node.token.value); |
| 120 } | 120 } |
| 121 | 121 |
| 122 visitLiteralStringJuxtaposition(LiteralStringJuxtaposition node) { | 122 visitStringJuxtaposition(LiteralStringJuxtaposition node) { |
| 123 for (Link<Expression> literals = node.literals; | 123 visit(node.first); |
| 124 !literals.isEmpty(); | 124 sb.add(" "); |
| 125 literals = literals.tail) { | 125 visit(node.second); |
| 126 visit(literals.head); | |
| 127 if (!literals.tail.isEmpty()) { | |
| 128 sb.add(" "); | |
| 129 } | |
| 130 } | |
| 131 } | 126 } |
| 132 | 127 |
| 133 visitLiteralNull(LiteralNull node) { | 128 visitLiteralNull(LiteralNull node) { |
| 134 add(node.token.value); | 129 add(node.token.value); |
| 135 } | 130 } |
| 136 | 131 |
| 137 visitNewExpression(NewExpression node) { | 132 visitNewExpression(NewExpression node) { |
| 138 add(node.newToken.value); | 133 add(node.newToken.value); |
| 139 sb.add(' '); | 134 sb.add(' '); |
| 140 visit(node.send); | 135 visit(node.send); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 sb.add(' '); | 382 sb.add(' '); |
| 388 } | 383 } |
| 389 visit(node.name); | 384 visit(node.name); |
| 390 if (node.typeParameters !== null) { | 385 if (node.typeParameters !== null) { |
| 391 visit(node.typeParameters); | 386 visit(node.typeParameters); |
| 392 } | 387 } |
| 393 visit(node.formals); | 388 visit(node.formals); |
| 394 add(node.endToken.value); | 389 add(node.endToken.value); |
| 395 } | 390 } |
| 396 } | 391 } |
| OLD | NEW |