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

Unified Diff: frog/utils.dart

Issue 8729018: Fixing string compile-time constant evaluation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 years, 1 month 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: frog/utils.dart
diff --git a/frog/utils.dart b/frog/utils.dart
index 657349a6cf0c7d20ca3ed3c89286791ad5b32128..d9853f8f151b6ed85dd7f3cd6dc12df6a12f89bd 100644
--- a/frog/utils.dart
+++ b/frog/utils.dart
@@ -70,6 +70,15 @@ bool isRawMultilineString(String text) {
return text.startsWith('@"""') || text.startsWith("@'''");
}
+/**
+ * Convert a single-quote string to be a double-quote string by replacing " with
+ * \" and \' with '.
+ */
+String toDoubleQuote(String s) {
+ return s.replaceAll('"', '\\"').replaceAll("\\'", "'");
+}
+
+
// TODO(jmesserly): it'd be nice to deal with this in the tokenizer, rather than
// taking another pass over the string.
String parseStringLiteral(String lit) {

Powered by Google App Engine
This is Rietveld 408576698