Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: lib/compiler/implementation/tree/prettyprint.dart

Issue 10792013: Enhance prettyprint for TypeAnnotation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698