Index: pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart |
diff --git a/pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart |
index 0ab8ca2226dc925f8de2cdfa0a9835208ed72413..b4088b3d4fd33ab5c7efae6f9bb560ff197deb5f 100644 |
--- a/pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart |
+++ b/pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart |
@@ -6,7 +6,9 @@ library fasta.scanner.utf8_bytes_scanner; |
import 'dart:convert' show UNICODE_BOM_CHARACTER_RUNE, UTF8; |
-import '../../scanner/token.dart' show TokenType; |
+import '../../scanner/token.dart' show SyntheticStringToken, TokenType; |
+ |
+import '../../scanner/token.dart' as analyzer show StringToken; |
import '../scanner.dart' show unicodeReplacementCharacter; |
@@ -198,7 +200,8 @@ class Utf8BytesScanner extends ArrayBasedScanner { |
} |
@override |
- StringToken createSubstringToken(TokenType type, int start, bool asciiOnly, |
+ analyzer.StringToken createSubstringToken( |
+ TokenType type, int start, bool asciiOnly, |
[int extraOffset = 0]) { |
return new StringToken.fromUtf8Bytes( |
type, bytes, start, byteOffset + extraOffset, asciiOnly, tokenStart, |
@@ -206,6 +209,14 @@ class Utf8BytesScanner extends ArrayBasedScanner { |
} |
@override |
+ analyzer.StringToken createSyntheticSubstringToken( |
+ TokenType type, int start, bool asciiOnly, String closingQuotes) { |
+ String source = StringToken.decodeUtf8(bytes, start, byteOffset, asciiOnly); |
+ return new SyntheticStringToken( |
+ type, source + closingQuotes, start, source.length); |
+ } |
+ |
+ @override |
CommentToken createCommentToken(TokenType type, int start, bool asciiOnly, |
[int extraOffset = 0]) { |
return new CommentToken.fromUtf8Bytes( |