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

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

Issue 10824113: Fix interpolation unparse. (Closed) Base URL: https://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 unified diff | Download patch | Annotate | Revision Log
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 class Unparser implements Visitor { 5 class Unparser implements Visitor {
6 final Renamer renamer; 6 final Renamer renamer;
7 StringBuffer sb; 7 StringBuffer sb;
8 8
9 Unparser([this.renamer = const Renamer()]); 9 Unparser([this.renamer = const Renamer()]);
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 visit(node.elements); 187 visit(node.elements);
188 } 188 }
189 189
190 visitModifiers(Modifiers node) => node.visitChildren(this); 190 visitModifiers(Modifiers node) => node.visitChildren(this);
191 191
192 /** 192 /**
193 * Unparses given NodeList starting from specific node. 193 * Unparses given NodeList starting from specific node.
194 */ 194 */
195 unparseNodeListFrom(NodeList node, Link<Node> from) { 195 unparseNodeListFrom(NodeList node, Link<Node> from) {
196 if (from.isEmpty()) return; 196 if (from.isEmpty()) return;
197 String delimiter = (node.delimiter === null) ? " " : "${node.delimiter} "; 197 String delimiter = (node.delimiter === null) ? " " : "${node.delimiter}";
198 visit(from.head); 198 visit(from.head);
199 for (Link link = from.tail; !link.isEmpty(); link = link.tail) { 199 for (Link link = from.tail; !link.isEmpty(); link = link.tail) {
200 sb.add(delimiter); 200 sb.add(delimiter);
201 visit(link.head); 201 visit(link.head);
202 } 202 }
203 } 203 }
204 204
205 visitNodeList(NodeList node) { 205 visitNodeList(NodeList node) {
206 if (node.beginToken !== null) add(node.beginToken.value); 206 if (node.beginToken !== null) add(node.beginToken.value);
207 if (node.nodes !== null) { 207 if (node.nodes !== null) {
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 sb.add(' '); 513 sb.add(' ');
514 } 514 }
515 visit(node.name); 515 visit(node.name);
516 if (node.typeParameters !== null) { 516 if (node.typeParameters !== null) {
517 visit(node.typeParameters); 517 visit(node.typeParameters);
518 } 518 }
519 visit(node.formals); 519 visit(node.formals);
520 add(node.endToken.value); 520 add(node.endToken.value);
521 } 521 }
522 } 522 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698