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

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

Issue 27510003: Scanner for UTF-8 byte arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixes compiler tests Created 7 years, 2 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/string_validator.dart
diff --git a/sdk/lib/_internal/compiler/implementation/string_validator.dart b/sdk/lib/_internal/compiler/implementation/string_validator.dart
index b3d234580b7f686ed328430056d6fa9d541e9f94..98ad8fab7730b0e841683b383f80d8401eb2e72f 100644
--- a/sdk/lib/_internal/compiler/implementation/string_validator.dart
+++ b/sdk/lib/_internal/compiler/implementation/string_validator.dart
@@ -81,6 +81,18 @@ class StringValidator {
return StringQuoting.getQuoting(quoteChar, raw, quoteLength);
}
+ /**
+ * Return the string [string] witout its [initial] first and [terminal] last
+ * characters. This is intended to be used to remove quotes from string
+ * literals (including an initial 'r' for raw strings).
+ */
+ String copyWithoutQuotes(String string, int initial, int terminal) {
+ assert(0 <= initial);
+ assert(0 <= terminal);
+ assert(initial + terminal <= string.length);
+ return string.substring(initial, string.length - terminal);
+ }
+
void stringParseError(String message, Token token, int offset) {
listener.cancel("$message @ $offset", token : token);
}

Powered by Google App Engine
This is Rietveld 408576698