| 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 // Returns null if no need to rename a node. | 5 // Returns null if no need to rename a node. |
| 6 typedef String Renamer(Node node); | 6 typedef String Renamer(Node node); |
| 7 | 7 |
| 8 class Unparser implements Visitor { | 8 class Unparser implements Visitor { |
| 9 Renamer rename; | 9 Renamer rename; |
| 10 StringBuffer sb; | 10 StringBuffer sb; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 add(node.token.value); | 199 add(node.token.value); |
| 200 } | 200 } |
| 201 | 201 |
| 202 visitNewExpression(NewExpression node) { | 202 visitNewExpression(NewExpression node) { |
| 203 addToken(node.newToken); | 203 addToken(node.newToken); |
| 204 visit(node.send); | 204 visit(node.send); |
| 205 } | 205 } |
| 206 | 206 |
| 207 visitLiteralList(LiteralList node) { | 207 visitLiteralList(LiteralList node) { |
| 208 addToken(node.constKeyword); | 208 addToken(node.constKeyword); |
| 209 if (node.type !== null) { | 209 visit(node.typeArguments); |
| 210 sb.add('<'); | |
| 211 visit(node.type); | |
| 212 sb.add('>'); | |
| 213 } | |
| 214 visit(node.elements); | 210 visit(node.elements); |
| 215 } | 211 } |
| 216 | 212 |
| 217 visitModifiers(Modifiers node) => node.visitChildren(this); | 213 visitModifiers(Modifiers node) => node.visitChildren(this); |
| 218 | 214 |
| 219 /** | 215 /** |
| 220 * Unparses given NodeList starting from specific node. | 216 * Unparses given NodeList starting from specific node. |
| 221 */ | 217 */ |
| 222 unparseNodeListFrom(NodeList node, Link<Node> from) { | 218 unparseNodeListFrom(NodeList node, Link<Node> from) { |
| 223 if (from.isEmpty()) return; | 219 if (from.isEmpty()) return; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 sb.add(' '); | 496 sb.add(' '); |
| 501 } | 497 } |
| 502 visit(node.name); | 498 visit(node.name); |
| 503 if (node.typeParameters !== null) { | 499 if (node.typeParameters !== null) { |
| 504 visit(node.typeParameters); | 500 visit(node.typeParameters); |
| 505 } | 501 } |
| 506 visit(node.formals); | 502 visit(node.formals); |
| 507 add(node.endToken.value); | 503 add(node.endToken.value); |
| 508 } | 504 } |
| 509 } | 505 } |
| OLD | NEW |