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

Unified Diff: runtime/vm/object.cc

Issue 12605009: Fix source generation for strings that have \$ in them. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/bin/main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 19996)
+++ runtime/vm/object.cc (working copy)
@@ -4854,6 +4854,9 @@
escape_characters = true;
}
}
+ if ((literal.CharAt(i) == '$')) {
Ivan Posva 2013/03/18 18:12:22 $ should be a SpecialCharacter and then you would
siva 2013/03/19 17:08:31 The raw string processing was interfering with tre
+ escape_characters = true;
+ }
}
if ((prev != Token::kINTERPOL_VAR) && (prev != Token::kINTERPOL_END)) {
if (is_raw_string) {
@@ -11483,6 +11486,7 @@
intptr_t index = 0;
for (intptr_t i = 0; i < len; i++) {
if (IsSpecialCharacter(*CharAddr(str, i)) ||
+ (!raw_str && (*CharAddr(str, i) == '$')) ||
(!raw_str && (*CharAddr(str, i) == '\\'))) {
num_escapes += 1;
}
@@ -11494,6 +11498,10 @@
*(CharAddr(dststr, index)) = '\\';
*(CharAddr(dststr, index + 1)) = SpecialCharacter(*CharAddr(str, i));
index += 2;
+ } else if (!raw_str && (*CharAddr(str, i) == '$')) {
+ *(CharAddr(dststr, index)) = '\\';
+ *(CharAddr(dststr, index + 1)) = '$';
+ index += 2;
} else if (!raw_str && (*CharAddr(str, i) == '\\')) {
*(CharAddr(dststr, index)) = '\\';
*(CharAddr(dststr, index + 1)) = '\\';
« no previous file with comments | « runtime/bin/main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698