| Index: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
|
| index 2d072322b1b53eff4873c69bbc5c44a99bdf1a36..d4a97e0f255a561ece55c8425760c39f873f68e4 100644
|
| --- a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
|
| +++ b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
|
| @@ -8,8 +8,7 @@ import 'dart:collection' show ListMixin;
|
|
|
| import 'dart:typed_data' show Uint16List, Uint32List;
|
|
|
| -import '../../scanner/token.dart'
|
| - show BeginToken, SyntheticStringToken, Token, TokenType;
|
| +import '../../scanner/token.dart' show BeginToken, Token, TokenType;
|
|
|
| import '../scanner.dart'
|
| show ErrorToken, Keyword, Scanner, buildUnexpectedCharacterToken;
|
| @@ -1025,7 +1024,7 @@ abstract class AbstractScanner implements Scanner {
|
| identical(next, $CR) ||
|
| identical(next, $EOF))) {
|
| if (!asciiOnly) handleUnicode(start);
|
| - return unterminatedString(quoteChar, start, asciiOnly);
|
| + return unterminatedString(quoteChar);
|
| }
|
| if (next > 127) asciiOnly = false;
|
| next = advance();
|
| @@ -1090,14 +1089,14 @@ abstract class AbstractScanner implements Scanner {
|
| return next;
|
| } else if (identical(next, $LF) || identical(next, $CR)) {
|
| if (!asciiOnly) handleUnicode(start);
|
| - return unterminatedRawString(quoteChar, start, asciiOnly);
|
| + return unterminatedRawString(quoteChar);
|
| } else if (next > 127) {
|
| asciiOnly = false;
|
| }
|
| next = advance();
|
| }
|
| if (!asciiOnly) handleUnicode(start);
|
| - return unterminatedRawString(quoteChar, start, asciiOnly);
|
| + return unterminatedRawString(quoteChar);
|
| }
|
|
|
| int tokenizeMultiLineRawString(int quoteChar, int start) {
|
| @@ -1135,7 +1134,7 @@ abstract class AbstractScanner implements Scanner {
|
| }
|
| }
|
| if (!asciiOnlyLine) handleUnicode(unicodeStart);
|
| - return unterminatedRawMultiLineString(quoteChar, start, asciiOnlyLine);
|
| + return unterminatedRawMultiLineString(quoteChar);
|
| }
|
|
|
| int tokenizeMultiLineString(int quoteChar, int start, bool raw) {
|
| @@ -1186,7 +1185,7 @@ abstract class AbstractScanner implements Scanner {
|
| next = advance();
|
| }
|
| if (!asciiOnlyLine) handleUnicode(unicodeStart);
|
| - return unterminatedMultiLineString(quoteChar, start, asciiOnlyString);
|
| + return unterminatedMultiLineString(quoteChar);
|
| }
|
|
|
| int unexpected(int character) {
|
| @@ -1199,40 +1198,22 @@ abstract class AbstractScanner implements Scanner {
|
| return advanceAfterError(shouldAdvance);
|
| }
|
|
|
| - void terminateUnterminatedString(
|
| - int start, bool asciiOnlyString, String suffix) {
|
| - if (start < scanOffset) {
|
| - appendSubstringToken(TokenType.STRING, start, asciiOnlyString);
|
| - }
|
| - beginToken();
|
| - appendToken(
|
| - new SyntheticStringToken(TokenType.STRING, suffix, tokenStart, 0));
|
| - }
|
| -
|
| - int unterminatedString(int quoteChar, int start, bool asciiOnlyString) {
|
| - String suffix = new String.fromCharCodes([quoteChar]);
|
| - terminateUnterminatedString(start, asciiOnlyString, suffix);
|
| - return unterminated(suffix);
|
| + int unterminatedString(int quoteChar) {
|
| + return unterminated(new String.fromCharCodes([quoteChar]));
|
| }
|
|
|
| - int unterminatedRawString(int quoteChar, int start, bool asciiOnlyString) {
|
| - String suffix = new String.fromCharCodes([quoteChar]);
|
| - terminateUnterminatedString(start, asciiOnlyString, suffix);
|
| - return unterminated('r$suffix');
|
| + int unterminatedRawString(int quoteChar) {
|
| + return unterminated('r${new String.fromCharCodes([quoteChar])}');
|
| }
|
|
|
| - int unterminatedMultiLineString(
|
| - int quoteChar, int start, bool asciiOnlyString) {
|
| - String suffix = new String.fromCharCodes([quoteChar, quoteChar, quoteChar]);
|
| - terminateUnterminatedString(start, asciiOnlyString, suffix);
|
| - return unterminated(suffix);
|
| + int unterminatedMultiLineString(int quoteChar) {
|
| + return unterminated(
|
| + new String.fromCharCodes([quoteChar, quoteChar, quoteChar]));
|
| }
|
|
|
| - int unterminatedRawMultiLineString(
|
| - int quoteChar, int start, bool asciiOnlyString) {
|
| - String suffix = new String.fromCharCodes([quoteChar, quoteChar, quoteChar]);
|
| - terminateUnterminatedString(start, asciiOnlyString, suffix);
|
| - return unterminated('r$suffix');
|
| + int unterminatedRawMultiLineString(int quoteChar) {
|
| + return unterminated(
|
| + 'r${new String.fromCharCodes([quoteChar, quoteChar, quoteChar])}');
|
| }
|
|
|
| int advanceAfterError(bool shouldAdvance) {
|
|
|