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

Side by Side Diff: frog/leg/tree/unparser.dart

Issue 9642001: Make string juxtaposition combine properly with string interpolations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refactor juxtaposition handling. Created 8 years, 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 StringBuffer sb; 6 StringBuffer sb;
7 final bool printDebugInfo; 7 final bool printDebugInfo;
8 8
9 Unparser([this.printDebugInfo = false]); 9 Unparser([this.printDebugInfo = false]);
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 visitLiteralInt(LiteralInt node) { 114 visitLiteralInt(LiteralInt node) {
115 add(node.token.value); 115 add(node.token.value);
116 } 116 }
117 117
118 visitLiteralString(LiteralString node) { 118 visitLiteralString(LiteralString node) {
119 add(node.token.value); 119 add(node.token.value);
120 } 120 }
121 121
122 visitLiteralStringJuxtaposition(LiteralStringJuxtaposition node) { 122 visitStringJuxtaposition(LiteralStringJuxtaposition node) {
123 for (Link<Expression> literals = node.literals; 123 visit(node.first);
124 !literals.isEmpty(); 124 sb.add(" ");
125 literals = literals.tail) { 125 visit(node.second);
126 visit(literals.head);
127 if (!literals.tail.isEmpty()) {
128 sb.add(" ");
129 }
130 }
131 } 126 }
132 127
133 visitLiteralNull(LiteralNull node) { 128 visitLiteralNull(LiteralNull node) {
134 add(node.token.value); 129 add(node.token.value);
135 } 130 }
136 131
137 visitNewExpression(NewExpression node) { 132 visitNewExpression(NewExpression node) {
138 add(node.newToken.value); 133 add(node.newToken.value);
139 sb.add(' '); 134 sb.add(' ');
140 visit(node.send); 135 visit(node.send);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 sb.add(' '); 382 sb.add(' ');
388 } 383 }
389 visit(node.name); 384 visit(node.name);
390 if (node.typeParameters !== null) { 385 if (node.typeParameters !== null) {
391 visit(node.typeParameters); 386 visit(node.typeParameters);
392 } 387 }
393 visit(node.formals); 388 visit(node.formals);
394 add(node.endToken.value); 389 add(node.endToken.value);
395 } 390 }
396 } 391 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698