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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: frog/tokenizer.dart
diff --git a/frog/tokenizer.dart b/frog/tokenizer.dart
index da7338438ff831420ac1bbc7e9ee807c6d723337..2cfdec6bf4fac2ea52f2858c3f9f99947f8aa3be 100644
--- a/frog/tokenizer.dart
+++ b/frog/tokenizer.dart
@@ -379,17 +379,28 @@ class TokenizerBase extends TokenizerHelpers {
}
}
- Token finishIdentifier() {
- while (_index < _text.length) {
- if (!isIdentifierPart(_text.charCodeAt(_index++))) {
- _index--;
- break;
- }
- }
- int kind = getIdentifierKind();
+ Token finishIdentifier(int ch) {
if (_interpStack != null && _interpStack.depth == -1) {
_interpStack.depth = 0;
+ if (ch == 36/*$*/) {
+ // illegal character after $ in string interpolation
+ return _errorToken();
+ }
+ while (_index < _text.length) {
+ if (!isInterpIdentifierPart(_text.charCodeAt(_index++))) {
+ _index--;
+ break;
+ }
+ }
+ } else {
+ while (_index < _text.length) {
+ if (!isIdentifierPart(_text.charCodeAt(_index++))) {
+ _index--;
+ break;
+ }
+ }
}
+ int kind = getIdentifierKind();
if (kind == TokenKind.IDENTIFIER) {
return _finishToken(TokenKind.IDENTIFIER);
} else {

Powered by Google App Engine
This is Rietveld 408576698