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

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

Issue 11318018: - Represent strings internally in UTF-16 format, this makes it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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: lib/compiler/implementation/string_validator.dart
===================================================================
--- lib/compiler/implementation/string_validator.dart (revision 14156)
+++ lib/compiler/implementation/string_validator.dart (working copy)
@@ -99,7 +99,9 @@
for(Iterator<int> iter = string.iterator(); iter.hasNext; length++) {
index++;
int code = iter.next();
+ bool verify_code = false;
ngeoffray 2012/10/27 09:02:00 verify_code -> verifyCode
if (code == $BACKSLASH) {
+ verify_code = true;
if (quoting.raw) continue;
containsEscape = true;
if (!iter.hasNext) {
@@ -170,7 +172,7 @@
}
// This handles both unescaped characters and the value of unicode
ahe 2012/10/28 12:07:02 I don't think this comment is correct any more.
// escapes.
- if (!isUnicodeScalarValue(code)) {
+ if (verify_code && !isUnicodeScalarValue(code)) {
ahe 2012/10/28 12:07:02 This doesn't look right to me. If we are switching
cshapiro 2012/10/29 06:37:17 The specification for string literals was delibera
ahe 2012/10/29 08:11:07 If the underlying string representation is UTF-16,
siva 2012/10/31 01:21:26 I have decided to drop these changes made to dart2
stringParseError(
"Invalid Unicode scalar value U+${code.toRadixString(16)}",
token, index);

Powered by Google App Engine
This is Rietveld 408576698