| 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 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 sb.add(' '); | 390 sb.add(' '); |
| 396 } | 391 } |
| 397 visit(node.name); | 392 visit(node.name); |
| 398 if (node.typeParameters !== null) { | 393 if (node.typeParameters !== null) { |
| 399 visit(node.typeParameters); | 394 visit(node.typeParameters); |
| 400 } | 395 } |
| 401 visit(node.formals); | 396 visit(node.formals); |
| 402 add(node.endToken.value); | 397 add(node.endToken.value); |
| 403 } | 398 } |
| 404 } | 399 } |
| OLD | NEW |