| 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Pretty-prints Node tree in XML-like format. | 8 * Pretty-prints Node tree in XML-like format. |
| 9 * | 9 * |
| 10 * TODO(smok): Add main() to run from command-line to print out tree for given | 10 * TODO(smok): Add main() to run from command-line to print out tree for given |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 visitRethrow(Rethrow node) { | 307 visitRethrow(Rethrow node) { |
| 308 visitNodeWithChildren(node, "Rethrow"); | 308 visitNodeWithChildren(node, "Rethrow"); |
| 309 } | 309 } |
| 310 | 310 |
| 311 visitReturn(Return node) { | 311 visitReturn(Return node) { |
| 312 openNode(node, "Return"); | 312 openNode(node, "Return"); |
| 313 visitChildNode(node.expression, "expression"); | 313 visitChildNode(node.expression, "expression"); |
| 314 closeNode(); | 314 closeNode(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 visitScriptTag(ScriptTag node) { | |
| 318 visitNodeWithChildren(node, "ScriptTag"); | |
| 319 } | |
| 320 | |
| 321 visitChildNode(Node node, String fieldName) { | 317 visitChildNode(Node node, String fieldName) { |
| 322 if (node == null) return; | 318 if (node == null) return; |
| 323 addCurrentIndent(); | 319 addCurrentIndent(); |
| 324 sb.write("<$fieldName>\n"); | 320 sb.write("<$fieldName>\n"); |
| 325 pushTag(fieldName); | 321 pushTag(fieldName); |
| 326 node.accept(this); | 322 node.accept(this); |
| 327 popTag(); | 323 popTag(); |
| 328 addCurrentIndent(); | 324 addCurrentIndent(); |
| 329 sb.write("</$fieldName>\n"); | 325 sb.write("</$fieldName>\n"); |
| 330 } | 326 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } | 470 } |
| 475 | 471 |
| 476 visitStringNode(StringNode node) { | 472 visitStringNode(StringNode node) { |
| 477 unimplemented('visitNode', node: node); | 473 unimplemented('visitNode', node: node); |
| 478 } | 474 } |
| 479 | 475 |
| 480 unimplemented(String message, {Node node}) { | 476 unimplemented(String message, {Node node}) { |
| 481 throw message; | 477 throw message; |
| 482 } | 478 } |
| 483 } | 479 } |
| OLD | NEW |