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

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: Addressed review comments. 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
« no previous file with comments | « frog/leg/scanner/listener.dart ('k') | frog/leg/scanner/scanner_task.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 } 1199 }
1200 1200
1201 Token parseLiteralString(Token token) { 1201 Token parseLiteralString(Token token) {
1202 token = parseSingleLiteralString(token); 1202 token = parseSingleLiteralString(token);
1203 int count = 1; 1203 int count = 1;
1204 while (token.kind === STRING_TOKEN) { 1204 while (token.kind === STRING_TOKEN) {
1205 token = parseSingleLiteralString(token); 1205 token = parseSingleLiteralString(token);
1206 count++; 1206 count++;
1207 } 1207 }
1208 if (count > 1) { 1208 if (count > 1) {
1209 listener.handleLiteralStringJuxtaposition(count); 1209 listener.handleStringJuxtaposition(count);
1210 } 1210 }
1211 return token; 1211 return token;
1212 } 1212 }
1213 1213
1214 Token parseSingleLiteralString(Token token) { 1214 Token parseSingleLiteralString(Token token) {
1215 listener.beginLiteralString(token); 1215 listener.beginLiteralString(token);
1216 token = token.next; 1216 token = token.next;
1217 int interpolationCount = 0; 1217 int interpolationCount = 0;
1218 while (optional('\${', token)) { 1218 while (optional('\${', token)) {
1219 token = token.next; 1219 token = token.next;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 } 1579 }
1580 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1580 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1581 return expectSemicolon(token); 1581 return expectSemicolon(token);
1582 } 1582 }
1583 1583
1584 Token parseEmptyStatement(Token token) { 1584 Token parseEmptyStatement(Token token) {
1585 listener.handleEmptyStatement(token); 1585 listener.handleEmptyStatement(token);
1586 return expectSemicolon(token); 1586 return expectSemicolon(token);
1587 } 1587 }
1588 } 1588 }
OLDNEW
« no previous file with comments | « frog/leg/scanner/listener.dart ('k') | frog/leg/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698