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

Unified Diff: sdk/lib/_internal/compiler/implementation/scanner/scanner.dart

Issue 340703003: Prevent double reporting on hex, strings, and multiline comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments and comments Created 6 years, 4 months 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: sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart b/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
index 34cac3a3bacd90757908e5b226a6eba60fa75a7d..8a3880242bc6e7943b3053e65f5b10bf658b23cf 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/scanner.dart
@@ -628,7 +628,8 @@ abstract class AbstractScanner implements Scanner {
hasDigits = true;
} else {
if (!hasDigits) {
- return unterminated('0x');
+ unterminated('0x', shouldAdvance: false);
+ return next;
}
appendSubstringToken(HEXADECIMAL_INFO, start, true);
return next;
@@ -949,7 +950,6 @@ abstract class AbstractScanner implements Scanner {
int tokenizeSingleLineRawString(int next, int quoteChar, int start) {
bool asciiOnly = true;
- next = advance(); // Advance past the quote.
while (next != $EOF) {
if (identical(next, quoteChar)) {
if (!asciiOnly) handleUnicode(start);
@@ -1078,6 +1078,7 @@ abstract class AbstractScanner implements Scanner {
return unterminated(
new String.fromCharCodes([quoteChar, quoteChar, quoteChar]));
}
+
int unterminatedRawMultiLineString(int quoteChar) {
return unterminated(
'r${new String.fromCharCodes([quoteChar, quoteChar, quoteChar])}');
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/scanner/parser.dart ('k') | tests/compiler/dart2js/message_kind_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698