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

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

Issue 10834374: Add a field to ClassNode that holds a NodeList of its members. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
Index: lib/compiler/implementation/tree/unparser.dart
===================================================================
--- lib/compiler/implementation/tree/unparser.dart (revision 10901)
+++ lib/compiler/implementation/tree/unparser.dart (working copy)
@@ -60,6 +60,9 @@
visitClassNode(ClassNode node) {
addToken(node.beginToken);
visit(node.name);
+ if (node.typeParameters != null) {
+ visit(node.typeParameters);
+ }
sb.add(' ');
if (node.extendsKeyword !== null) {
addToken(node.extendsKeyword);
@@ -72,6 +75,21 @@
sb.add(' ');
}
sb.add('{\n');
+ NodeList body = node.body;
+ if (body != null) {
+ Link nodes = body.nodes;
+ if (!nodes.isEmpty()) {
ahe 2012/08/21 11:56:17 This is probably: nodes.printOn(sb, '\n ');
messick 2012/08/21 15:35:40 That would leave indentation at the end of the las
ahe 2012/08/21 15:43:16 That would be a bug in printOn. The second argumen
messick 2012/08/21 16:31:19 Done.
+ String indent = " ";
+ sb.add(indent);
+ visit(nodes.head);
+ sb.add("\n");
+ for (Link node = nodes.tail; !node.isEmpty(); node = node.tail) {
+ sb.add(indent);
+ visit(node.head);
+ sb.add("\n");
+ }
+ }
+ }
sb.add('}\n');
}

Powered by Google App Engine
This is Rietveld 408576698