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

Side by Side Diff: frog/tokenizer.dart

Issue 8585044: Fixes issues in string interpolation tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debugging code Created 9 years, 1 month 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 // Generated by scripts/tokenizer_gen.py. 4 // Generated by scripts/tokenizer_gen.py.
5 5
6 class InterpStack { 6 class InterpStack {
7 InterpStack next, previous; 7 InterpStack next, previous;
8 final int quote; 8 final int quote;
9 final bool isMultiline; 9 final bool isMultiline;
10 int depth; 10 int depth;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 Token finishDot() { 373 Token finishDot() {
374 if (isDigit(_peekChar())) { 374 if (isDigit(_peekChar())) {
375 eatDigits(); 375 eatDigits();
376 return finishNumberExtra(TokenKind.DOUBLE); 376 return finishNumberExtra(TokenKind.DOUBLE);
377 } else { 377 } else {
378 return _finishToken(TokenKind.DOT); 378 return _finishToken(TokenKind.DOT);
379 } 379 }
380 } 380 }
381 381
382 Token finishIdentifier() { 382 Token finishIdentifier(int ch) {
383 while (_index < _text.length) { 383 if (_interpStack != null && _interpStack.depth == -1) {
384 if (!isIdentifierPart(_text.charCodeAt(_index++))) { 384 _interpStack.depth = 0;
385 _index--; 385 if (ch == 36/*$*/) {
386 break; 386 // illegal character after $ in string interpolation
387 return _errorToken();
388 }
389 while (_index < _text.length) {
390 if (!isInterpIdentifierPart(_text.charCodeAt(_index++))) {
391 _index--;
392 break;
393 }
394 }
395 } else {
396 while (_index < _text.length) {
397 if (!isIdentifierPart(_text.charCodeAt(_index++))) {
398 _index--;
399 break;
400 }
387 } 401 }
388 } 402 }
389 int kind = getIdentifierKind(); 403 int kind = getIdentifierKind();
390 if (_interpStack != null && _interpStack.depth == -1) {
391 _interpStack.depth = 0;
392 }
393 if (kind == TokenKind.IDENTIFIER) { 404 if (kind == TokenKind.IDENTIFIER) {
394 return _finishToken(TokenKind.IDENTIFIER); 405 return _finishToken(TokenKind.IDENTIFIER);
395 } else { 406 } else {
396 return _finishToken(kind); 407 return _finishToken(kind);
397 } 408 }
398 } 409 }
399 } 410 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698