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); |
} |