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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart

Issue 3002493002: generate synthetic and error tokens when missing digit (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4765edf929dea3ae669dc0f9a0a6b52910978e00..b60cf57883727dfe2cb727f130fbe8373b977deb 100644
--- a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
@@ -164,13 +164,13 @@ abstract class AbstractScanner implements Scanner {
/**
* Appends a substring from the scan offset [start] to the current
- * [scanOffset] plus [closingQuotes]. The closing quote(s) will be added
+ * [scanOffset] plus [syntheticChars]. The additional char(s) will be added
* to the unterminated string literal's lexeme but the returned
- * token's length will *not* include those closing quotes
+ * token's length will *not* include those additional char(s)
* so as to be true to the original source.
*/
void appendSyntheticSubstringToken(
- TokenType type, int start, bool asciiOnly, String closingQuotes);
+ TokenType type, int start, bool asciiOnly, String syntheticChars);
/** Documentation in subclass [ArrayBasedScanner]. */
void appendPrecedenceToken(TokenType type);
@@ -726,7 +726,9 @@ abstract class AbstractScanner implements Scanner {
hasExponentDigits = true;
} else {
if (!hasExponentDigits) {
- unterminated('1e', shouldAdvance: false);
+ appendSyntheticSubstringToken(TokenType.DOUBLE, start, true, '0');
+ appendErrorToken(
+ new UnterminatedToken('1e', tokenStart, stringOffset));
return next;
}
break;
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698