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

Side by Side Diff: runtime/vm/scanner.cc

Issue 11368138: Add some support for the code-point code-unit distinction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Implemented feedback from patch set 2. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/scanner.h" 5 #include "vm/scanner.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 491 }
492 if (is_valid && 492 if (is_valid &&
493 ((*code_point > 0x10FFFF) || 493 ((*code_point > 0x10FFFF) ||
494 ((*code_point & 0xFFFFF800) == 0xD800))) { 494 ((*code_point & 0xFFFFF800) == 0xD800))) {
495 ErrorMsg("invalid code point"); 495 ErrorMsg("invalid code point");
496 } 496 }
497 } 497 }
498 498
499 499
500 void Scanner::ScanLiteralStringChars(bool is_raw) { 500 void Scanner::ScanLiteralStringChars(bool is_raw) {
501 GrowableArray<uint32_t> string_chars(64); 501 GrowableArray<int32_t> string_chars(64);
502 502
503 ASSERT(IsScanningString()); 503 ASSERT(IsScanningString());
504 // We are at the first character of a string literal piece. A string literal 504 // We are at the first character of a string literal piece. A string literal
505 // can be broken up into multiple pieces by string interpolation. 505 // can be broken up into multiple pieces by string interpolation.
506 while (true) { 506 while (true) {
507 if ((c0_ == '\0') || ((c0_ == '\n') && !string_is_multiline_)) { 507 if ((c0_ == '\0') || ((c0_ == '\n') && !string_is_multiline_)) {
508 ErrorMsg("unterminated string literal"); 508 ErrorMsg("unterminated string literal");
509 EndStringLiteral(); 509 EndStringLiteral();
510 return; 510 return;
511 } 511 }
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 "%c%#"Px"", kPrivateKeySeparator, key_value); 952 "%c%#"Px"", kPrivateKeySeparator, key_value);
953 const String& result = String::Handle(String::New(private_key, Heap::kOld)); 953 const String& result = String::Handle(String::New(private_key, Heap::kOld));
954 return result.raw(); 954 return result.raw();
955 } 955 }
956 956
957 957
958 void Scanner::InitOnce() { 958 void Scanner::InitOnce() {
959 } 959 }
960 960
961 } // namespace dart 961 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698