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

Side by Side Diff: frog/leg/scanner/parser.dart

Issue 9190038: Handle escapes in string literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed validation from scanner Created 8 years, 11 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/characters.dart ('k') | frog/leg/scanner/scanner.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) 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 token = parseType(token.next); 225 token = parseType(token.next);
226 ++interfacesCount; 226 ++interfacesCount;
227 } while (optional(',', token)); 227 } while (optional(',', token));
228 } 228 }
229 token = parseClassBody(token); 229 token = parseClassBody(token);
230 listener.endClassDeclaration(interfacesCount, begin, extendsKeyword, 230 listener.endClassDeclaration(interfacesCount, begin, extendsKeyword,
231 implementsKeyword, token); 231 implementsKeyword, token);
232 return token.next; 232 return token.next;
233 } 233 }
234 234
235
235 Token parseString(Token token) { 236 Token parseString(Token token) {
236 if (token.kind === STRING_TOKEN) { 237 if (token.kind === STRING_TOKEN) {
237 listener.handleLiteralString(token); 238 listener.handleLiteralString(token);
238 return token.next; 239 return token.next;
239 } else { 240 } else {
240 return listener.expected('string', token); 241 return listener.expected('string', token);
241 } 242 }
242 } 243 }
243 244
244 Token parseIdentifier(Token token) { 245 Token parseIdentifier(Token token) {
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 } 1554 }
1554 listener.handleContinueStatement(hasTarget, continueKeyword, token); 1555 listener.handleContinueStatement(hasTarget, continueKeyword, token);
1555 return expectSemicolon(token); 1556 return expectSemicolon(token);
1556 } 1557 }
1557 1558
1558 Token parseEmptyStatement(Token token) { 1559 Token parseEmptyStatement(Token token) {
1559 listener.handleEmptyStatement(token); 1560 listener.handleEmptyStatement(token);
1560 return expectSemicolon(token); 1561 return expectSemicolon(token);
1561 } 1562 }
1562 } 1563 }
OLDNEW
« no previous file with comments | « frog/leg/scanner/characters.dart ('k') | frog/leg/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698