| Index: dart/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart b/dart/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
|
| index 8659eadef771a064a9d722556c46d2f6b8b5a5ba..45e2210751d5e4b995e0561c0a19c6d14ee02eeb 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
|
| @@ -376,7 +376,7 @@ abstract class AbstractScanner implements Scanner {
|
| return $EOF;
|
| }
|
| if (next < 0x1f) {
|
| - return error("unexpected character $next");
|
| + return error("unexpected character $next", next);
|
| }
|
|
|
| next = currentAsUnicode(next);
|
| @@ -388,7 +388,7 @@ abstract class AbstractScanner implements Scanner {
|
| return advance();
|
| }
|
|
|
| - return error("unexpected unicode character $next");
|
| + return error("unexpected unicode character $next", next);
|
| }
|
|
|
| int tokenizeTag(int next) {
|
| @@ -618,7 +618,7 @@ abstract class AbstractScanner implements Scanner {
|
| hasDigits = true;
|
| } else {
|
| if (!hasDigits) {
|
| - return error("hex digit expected");
|
| + return error("hex digit expected", next);
|
| }
|
| appendSubstringToken(HEXADECIMAL_INFO, start, true);
|
| return next;
|
| @@ -682,7 +682,7 @@ abstract class AbstractScanner implements Scanner {
|
| hasDigits = true;
|
| } else {
|
| if (!hasDigits) {
|
| - return error("digit expected");
|
| + return error("digit expected", next);
|
| }
|
| return next;
|
| }
|
| @@ -818,7 +818,7 @@ abstract class AbstractScanner implements Scanner {
|
| } else {
|
| // Identifier ends here.
|
| if (start == scanOffset) {
|
| - return error("expected identifier");
|
| + return error("expected identifier", next);
|
| } else {
|
| appendSubstringToken(IDENTIFIER_INFO, start, true);
|
| }
|
| @@ -882,7 +882,7 @@ abstract class AbstractScanner implements Scanner {
|
| identical(next, $CR) ||
|
| identical(next, $EOF))) {
|
| if (!asciiOnly) handleUnicode(start);
|
| - return error("unterminated string literal");
|
| + return error("unterminated string literal", next);
|
| }
|
| if (next > 127) asciiOnly = false;
|
| next = advance();
|
| @@ -937,14 +937,14 @@ abstract class AbstractScanner implements Scanner {
|
| return next;
|
| } else if (identical(next, $LF) || identical(next, $CR)) {
|
| if (!asciiOnly) handleUnicode(start);
|
| - return error("unterminated string literal");
|
| + return error("unterminated string literal", next);
|
| } else if (next > 127) {
|
| asciiOnly = false;
|
| }
|
| next = advance();
|
| }
|
| if (!asciiOnly) handleUnicode(start);
|
| - return error("unterminated string literal");
|
| + return error("unterminated string literal", next);
|
| }
|
|
|
| int tokenizeMultiLineRawString(int quoteChar, int start) {
|
| @@ -981,7 +981,7 @@ abstract class AbstractScanner implements Scanner {
|
| }
|
| }
|
| if (!asciiOnlyLine) handleUnicode(unicodeStart);
|
| - return error("unterminated string literal");
|
| + return error("unterminated string literal", next);
|
| }
|
|
|
| int tokenizeMultiLineString(int quoteChar, int start, bool raw) {
|
| @@ -1032,11 +1032,12 @@ abstract class AbstractScanner implements Scanner {
|
| next = advance();
|
| }
|
| if (!asciiOnlyLine) handleUnicode(unicodeStart);
|
| - return error("unterminated string literal");
|
| + return error("unterminated string literal", next);
|
| }
|
|
|
| - int error(String message) {
|
| + int error(String message, next) {
|
| appendStringToken(BAD_INPUT_INFO, message);
|
| + if (next == 0) return 0;
|
| return advance(); // Ensure progress.
|
| }
|
|
|
|
|