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

Side by Side Diff: frog/leg/scanner/parser.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 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 /** 5 /**
6 * An event generating parser of Dart programs. This parser expects 6 * An event generating parser of Dart programs. This parser expects
7 * all tokens in a linked list. 7 * all tokens in a linked list.
8 */ 8 */
9 class Parser { 9 class Parser {
10 final Listener listener; 10 final Listener listener;
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 } 1215 }
1216 1216
1217 Token parseLiteralString(Token token) { 1217 Token parseLiteralString(Token token) {
1218 token = parseSingleLiteralString(token); 1218 token = parseSingleLiteralString(token);
1219 int count = 1; 1219 int count = 1;
1220 while (token.kind === STRING_TOKEN) { 1220 while (token.kind === STRING_TOKEN) {
1221 token = parseSingleLiteralString(token); 1221 token = parseSingleLiteralString(token);
1222 count++; 1222 count++;
1223 } 1223 }
1224 if (count > 1) { 1224 if (count > 1) {
1225 listener.handleLiteralStringJuxtaposition(count); 1225 listener.handleStringJuxtaposition(count);
1226 } 1226 }
1227 return token; 1227 return token;
1228 } 1228 }
1229 1229
1230 Token parseSingleLiteralString(Token token) { 1230 Token parseSingleLiteralString(Token token) {
1231 listener.beginLiteralString(token); 1231 listener.beginLiteralString(token);
1232 token = token.next; 1232 token = token.next;
1233 int interpolationCount = 0; 1233 int interpolationCount = 0;
1234 while (optional('\${', token)) { 1234 while (optional('\${', token)) {
1235 token = token.next; 1235 token = token.next;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 } 1595 }
1596 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1596 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1597 return expectSemicolon(token); 1597 return expectSemicolon(token);
1598 } 1598 }
1599 1599
1600 Token parseEmptyStatement(Token token) { 1600 Token parseEmptyStatement(Token token) {
1601 listener.handleEmptyStatement(token); 1601 listener.handleEmptyStatement(token);
1602 return expectSemicolon(token); 1602 return expectSemicolon(token);
1603 } 1603 }
1604 } 1604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698