| 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 /** | 5 /** |
| 6 * Pretty-prints Node tree in XML-like format. | 6 * Pretty-prints Node tree in XML-like format. |
| 7 * | 7 * |
| 8 * TODO(smok): Add main() to run from command-line to print out tree for given | 8 * TODO(smok): Add main() to run from command-line to print out tree for given |
| 9 * .dart file. | 9 * .dart file. |
| 10 */ | 10 */ |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 visitThrow(Throw node) { | 339 visitThrow(Throw node) { |
| 340 visitNodeWithChildren(node, "Throw"); | 340 visitNodeWithChildren(node, "Throw"); |
| 341 } | 341 } |
| 342 | 342 |
| 343 visitTryStatement(TryStatement node) { | 343 visitTryStatement(TryStatement node) { |
| 344 visitNodeWithChildren(node, "TryStatement"); | 344 visitNodeWithChildren(node, "TryStatement"); |
| 345 } | 345 } |
| 346 | 346 |
| 347 visitTypeAnnotation(TypeAnnotation node) { | 347 visitTypeAnnotation(TypeAnnotation node) { |
| 348 visitNodeWithChildren(node, "TypeAnnotation"); | 348 openNode("TypeAnnotation", { |
| 349 "beginToken" : tokenToStringOrNull(node.getBeginToken()), |
| 350 "endToken" : tokenToStringOrNull(node.getEndToken()) |
| 351 }); |
| 352 visitWithPrefix(node.typeName, "typeName:"); |
| 353 visitWithPrefix(node.typeArguments, "typeArguments:"); |
| 354 closeNode("TypeAnnotation"); |
| 349 } | 355 } |
| 350 | 356 |
| 351 visitTypedef(Typedef node) { | 357 visitTypedef(Typedef node) { |
| 352 visitNodeWithChildren(node, "Typedef"); | 358 visitNodeWithChildren(node, "Typedef"); |
| 353 } | 359 } |
| 354 | 360 |
| 355 visitTypeVariable(TypeVariable node) { | 361 visitTypeVariable(TypeVariable node) { |
| 356 visitNodeWithChildren(node, "TypeVariable"); | 362 visitNodeWithChildren(node, "TypeVariable"); |
| 357 } | 363 } |
| 358 | 364 |
| 359 visitVariableDefinitions(VariableDefinitions node) { | 365 visitVariableDefinitions(VariableDefinitions node) { |
| 360 openNode("VariableDefinitions", { | 366 openNode("VariableDefinitions", { |
| 361 "beginToken" : "${node.getBeginToken().stringValue}", | 367 "beginToken" : "${node.getBeginToken().stringValue}", |
| 362 "endToken" : "${node.getEndToken().stringValue}" | 368 "endToken" : "${node.getEndToken().stringValue}" |
| 363 }); | 369 }); |
| 364 visitWithPrefix(node.type, "type:"); | 370 visitWithPrefix(node.type, "type:"); |
| 365 visitWithPrefix(node.modifiers, "modifiers:"); | 371 visitWithPrefix(node.modifiers, "modifiers:"); |
| 366 visitWithPrefix(node.definitions, "definitions:"); | 372 visitWithPrefix(node.definitions, "definitions:"); |
| 367 closeNode("VariableDefinitions"); | 373 closeNode("VariableDefinitions"); |
| 368 } | 374 } |
| 369 | 375 |
| 370 visitWhile(While node) { | 376 visitWhile(While node) { |
| 371 visitNodeWithChildren(node, "While"); | 377 visitNodeWithChildren(node, "While"); |
| 372 } | 378 } |
| 373 } | 379 } |
| OLD | NEW |