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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 } | 298 } |
299 | 299 |
300 visitOperator(Operator node) { | 300 visitOperator(Operator node) { |
301 openAndCloseNode(node, "Operator", {"value" : node.token.slowToString()}); | 301 openAndCloseNode(node, "Operator", {"value" : node.token.slowToString()}); |
302 } | 302 } |
303 | 303 |
304 visitParenthesizedExpression(ParenthesizedExpression node) { | 304 visitParenthesizedExpression(ParenthesizedExpression node) { |
305 visitNodeWithChildren(node, "ParenthesizedExpression"); | 305 visitNodeWithChildren(node, "ParenthesizedExpression"); |
306 } | 306 } |
307 | 307 |
| 308 visitRethrow(Rethrow node) { |
| 309 visitNodeWithChildren(node, "Rethrow"); |
| 310 } |
| 311 |
308 visitReturn(Return node) { | 312 visitReturn(Return node) { |
309 openNode(node, "Return"); | 313 openNode(node, "Return"); |
310 visitChildNode(node.expression, "expression"); | 314 visitChildNode(node.expression, "expression"); |
311 closeNode(); | 315 closeNode(); |
312 } | 316 } |
313 | 317 |
314 visitScriptTag(ScriptTag node) { | 318 visitScriptTag(ScriptTag node) { |
315 visitNodeWithChildren(node, "ScriptTag"); | 319 visitNodeWithChildren(node, "ScriptTag"); |
316 } | 320 } |
317 | 321 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 475 } |
472 | 476 |
473 visitStringNode(StringNode node) { | 477 visitStringNode(StringNode node) { |
474 unimplemented('visitNode', node: node); | 478 unimplemented('visitNode', node: node); |
475 } | 479 } |
476 | 480 |
477 unimplemented(String message, {Node node}) { | 481 unimplemented(String message, {Node node}) { |
478 throw message; | 482 throw message; |
479 } | 483 } |
480 } | 484 } |
OLD | NEW |