| OLD | NEW |
| 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 ReadChar(); // Skip left curly bracket. | 514 ReadChar(); // Skip left curly bracket. |
| 515 is_valid = ScanHexDigits(1, 6, code_point); | 515 is_valid = ScanHexDigits(1, 6, code_point); |
| 516 if (is_valid) { | 516 if (is_valid) { |
| 517 if (c0_ != '}') { | 517 if (c0_ != '}') { |
| 518 ErrorMsg("expected '}' after character code"); | 518 ErrorMsg("expected '}' after character code"); |
| 519 return; | 519 return; |
| 520 } | 520 } |
| 521 } | 521 } |
| 522 } | 522 } |
| 523 if (is_valid && | 523 if (is_valid && |
| 524 ((*code_point > 0x10FFFF) || | 524 ((Utf::IsOutOfRange(*code_point) || |
| 525 ((*code_point & 0xFFFFF800) == 0xD800))) { | 525 (Utf16::IsSurrogate(*code_point))))) { |
| 526 ErrorMsg("invalid code point"); | 526 ErrorMsg("invalid code point"); |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 | 529 |
| 530 | 530 |
| 531 void Scanner::ScanLiteralStringChars(bool is_raw) { | 531 void Scanner::ScanLiteralStringChars(bool is_raw) { |
| 532 GrowableArray<int32_t> string_chars(64); | 532 GrowableArray<int32_t> string_chars(64); |
| 533 | 533 |
| 534 ASSERT(IsScanningString()); | 534 ASSERT(IsScanningString()); |
| 535 // We are at the first character of a string literal piece. A string literal | 535 // We are at the first character of a string literal piece. A string literal |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 "%c%#"Px"", kPrivateKeySeparator, key_value); | 986 "%c%#"Px"", kPrivateKeySeparator, key_value); |
| 987 const String& result = String::Handle(String::New(private_key, Heap::kOld)); | 987 const String& result = String::Handle(String::New(private_key, Heap::kOld)); |
| 988 return result.raw(); | 988 return result.raw(); |
| 989 } | 989 } |
| 990 | 990 |
| 991 | 991 |
| 992 void Scanner::InitOnce() { | 992 void Scanner::InitOnce() { |
| 993 } | 993 } |
| 994 | 994 |
| 995 } // namespace dart | 995 } // namespace dart |
| OLD | NEW |