| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |