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

Unified Diff: pkg/front_end/lib/src/fasta/quote.dart

Issue 2907093002: Revert "improve fasta unterminated string recovery" (Closed)
Patch Set: Created 3 years, 7 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: pkg/front_end/lib/src/fasta/quote.dart
diff --git a/pkg/front_end/lib/src/fasta/quote.dart b/pkg/front_end/lib/src/fasta/quote.dart
index 3d9c60375a0e1c0d84241414d17a1d824de13387..a0624144952c7ac9f67c17a7aacb6dad5b94138d 100644
--- a/pkg/front_end/lib/src/fasta/quote.dart
+++ b/pkg/front_end/lib/src/fasta/quote.dart
@@ -130,12 +130,10 @@ String unescapeLastStringPart(String last, Quote quote) {
String unescapeString(String string) {
Quote quote = analyzeQuote(string);
- int startIndex = firstQuoteLength(string, quote);
- if (startIndex == string.length) {
- return '';
- }
- int endIndex = string.length - lastQuoteLength(quote);
- return unescape(string.substring(startIndex, endIndex), quote);
+ return unescape(
+ string.substring(firstQuoteLength(string, quote),
+ string.length - lastQuoteLength(quote)),
+ quote);
}
String unescape(String string, Quote quote) {
« no previous file with comments | « pkg/compiler/lib/src/string_validator.dart ('k') | pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698