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

Unified Diff: lib/compiler/implementation/tree/prettyprint.dart

Issue 10546174: Better PrettyPrinter output for Return nodes, display tokens and expression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/prettyprint.dart
diff --git a/lib/compiler/implementation/tree/prettyprint.dart b/lib/compiler/implementation/tree/prettyprint.dart
index cb2eab34dd9f96c44c1cf77409481e67db438295..8cf1407bcafbabbb31f55aede91c16ad13e8d551 100644
--- a/lib/compiler/implementation/tree/prettyprint.dart
+++ b/lib/compiler/implementation/tree/prettyprint.dart
@@ -241,7 +241,14 @@ class PrettyPrinter implements Visitor {
}
visitReturn(Return node) {
- visitNodeWithChildren(node, "Return");
+ var beginToken =
+ node.beginToken != null ? node.beginToken.stringValue : "null";
Anton Muhin 2012/06/15 02:55:56 nit (here and below): !== null
Roman 2012/06/17 00:27:03 Done.
+ var endToken = node.endToken != null ? node.endToken.stringValue : "null";
+ openNode("Return", {"beginToken" : beginToken, "endToken" : endToken});
+ if (node.hasExpression) {
Anton Muhin 2012/06/15 02:55:56 nit: single line if?
Roman 2012/06/17 00:27:03 Done.
+ visitWithPrefix(node.expression, "expression:");
+ }
+ closeNode("Return");
}
visitScriptTag(ScriptTag node) {
« 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