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

Unified Diff: frog/leg/scanner/listener.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: Remove last bugs and clean up builder. 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 side-by-side diff with in-line comments
Download patch
Index: frog/leg/scanner/listener.dart
diff --git a/frog/leg/scanner/listener.dart b/frog/leg/scanner/listener.dart
index c30e564c2da92366c3c4f02139bfac290c77a47e..02bbcfbbd663fbb1be2e3eb33c66a1d4571bf6a7 100644
--- a/frog/leg/scanner/listener.dart
+++ b/frog/leg/scanner/listener.dart
@@ -170,7 +170,7 @@ class Listener {
void endLiteralString(int interpolationCount) {
}
- void handleLiteralStringJuxtaposition(int literalCount) {
+ void handleStringJuxtaposition(int literalCount) {
}
void beginMember(Token token) {
@@ -834,14 +834,16 @@ class ElementListener extends Listener {
}
}
- void handleLiteralStringJuxtaposition(int literalCount) {
- Link<Expression> literals = const EmptyLink<Expression>();
- while (literalCount > 0) {
+ void handleStringJuxtaposition(int stringCount) {
+ assert(stringCount != 0);
+ Expression accumulator = popNode();
+ stringCount -= 1;
+ while (stringCount > 0) {
Expression expression = popNode();
- literals = literals.prepend(expression);
- literalCount -= 1;
+ accumulator = new StringJuxtaposition(expression, accumulator);
+ stringCount -= 1;
}
- pushNode(new LiteralStringJuxtaposition(literals));
+ pushNode(accumulator);
}
}

Powered by Google App Engine
This is Rietveld 408576698