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

Issue 8386036: fix strings bug (Closed)

Created:
9 years, 1 month ago by Siggi Cherem (dart-lang)
Modified:
9 years, 1 month ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -3 lines) Patch
M member.dart View 1 chunk +2 lines, -3 lines 4 comments Download

Messages

Total messages: 5 (0 generated)
Siggi Cherem (dart-lang)
TBR
9 years, 1 month ago (2011-11-02 16:37:11 UTC) #1
ahe
I'm not sure I understand how this fixes the problem, but LGTM if it does ...
9 years, 1 month ago (2011-11-02 18:17:58 UTC) #2
jimhug
Can you help us understand why this change fixes the bug? http://codereview.chromium.org/8386036/diff/1/member.dart File member.dart (right): ...
9 years, 1 month ago (2011-11-03 00:57:21 UTC) #3
Siggi Cherem (dart-lang)
http://codereview.chromium.org/8386036/diff/1/member.dart File member.dart (right): http://codereview.chromium.org/8386036/diff/1/member.dart#newcode1021 member.dart:1021: value = '"' + value.replaceAll('"', '\\"') + '"'; On ...
9 years, 1 month ago (2011-11-03 17:31:28 UTC) #4
Jennifer Messerly
9 years, 1 month ago (2011-11-03 17:49:40 UTC) #5
http://codereview.chromium.org/8386036/diff/1/member.dart
File member.dart (right):

http://codereview.chromium.org/8386036/diff/1/member.dart#newcode1021
member.dart:1021: value = '"' + value.replaceAll('"', '\\"') + '"';
On 2011/11/03 17:31:28, sigmund wrote:
> On 2011/11/03 00:57:21, jimhug wrote:
> > This does seem to fix this issue - but I share Peter's puzzlement that this
> > works...
> > 
> > On 2011/11/02 18:17:58, ahe wrote:
> > > What happens with these strings:
> > > 
> > > "\""
> > > '\\"'
> > 
> 
> The issue is basically how we are representing strings as values. We tried to
> preserve the original quotes in the value that it generates. Every
compile-time
> concatenation of strings is removing the quotes, concatenating the contents,
and
> putting the quotes back. 
> 
> Before this change, we weren't putting the quotes back.
> 
> Your examples will likely break right now, so I'll work on fixing that. I
might
> change the compiler to not include the quotes when parsing, or be more careful
> about which quotes were used in val0/val1, and only escape strings when the
> quotes differ.

+1 on normalizing strings in the tokenizer, rather than keeping them as quoted
values everywhere. I suspect a lot of string handling code will become simpler.

Powered by Google App Engine
This is Rietveld 408576698