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

Unified Diff: pkg/front_end/lib/src/scanner/errors.dart

Issue 2772513006: fix missing digit error translation (Closed)
Patch Set: rebase Created 3 years, 9 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
« no previous file with comments | « no previous file | pkg/front_end/test/scanner_replacement_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/scanner/errors.dart
diff --git a/pkg/front_end/lib/src/scanner/errors.dart b/pkg/front_end/lib/src/scanner/errors.dart
index 0139561eab9fdd6452b352b7233c31e1546a0ced..3a8483fae17d0b8cf20fbb65632f04f4d9de67cd 100644
--- a/pkg/front_end/lib/src/scanner/errors.dart
+++ b/pkg/front_end/lib/src/scanner/errors.dart
@@ -105,12 +105,12 @@ void translateErrorToken(ErrorToken token, ReportError reportError) {
case ErrorKind.MissingExponent:
// TODO(paulberry,ahe): Fasta reports the error location as the entire
// number; analyzer expects the end of the number.
- charOffset = endOffset;
+ charOffset = endOffset - 1;
return _makeError(ScannerErrorCode.MISSING_DIGIT, null);
case ErrorKind.ExpectedHexDigit:
// TODO(paulberry,ahe): Fasta reports the error location as the entire
// number; analyzer expects the end of the number.
- charOffset = endOffset;
+ charOffset = endOffset - 1;
return _makeError(ScannerErrorCode.MISSING_HEX_DIGIT, null);
case ErrorKind.NonAsciiIdentifier:
case ErrorKind.NonAsciiWhitespace:
« no previous file with comments | « no previous file | pkg/front_end/test/scanner_replacement_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698