Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "src/char-predicates.h" |
| 6 | |
| 7 | #ifdef V8_I18N_SUPPORT |
| 8 | #include "unicode/uchar.h" |
| 9 | #include "unicode/urename.h" |
| 10 | #endif // V8_I18N_SUPPORT |
| 11 | |
| 12 | namespace v8 { |
| 13 | namespace internal { |
| 14 | |
| 15 | bool SupplementaryPlanes::IsIDStart(uc32 c) { |
| 16 | DCHECK(c > 0xFFFF); |
| 17 | #ifdef V8_I18N_SUPPORT |
| 18 | // This only works for code points in the SMPs, since ICU does not exclude |
| 19 | // code points with properties 'Pattern_Syntax' or 'Pattern_White_Space'. |
| 20 | // Code points in the SMP do not have those properties. |
| 21 | return u_isIDStart(c); |
| 22 | #else |
| 23 | // This is incorrect, but if we don't have ICU, use this as fallback. |
| 24 | return false; |
| 25 | #endif // V8_I18N_SUPPORT |
| 26 | } |
| 27 | |
| 28 | |
| 29 | bool SupplementaryPlanes::IsIDPart(uc32 c) { |
| 30 | DCHECK(c > 0xFFFF); |
| 31 | #ifdef V8_I18N_SUPPORT |
| 32 | // This only works for code points in the SMPs, since ICU does not exclude |
| 33 | // code points with properties 'Pattern_Syntax' or 'Pattern_White_Space'. |
| 34 | // Code points in the SMP do not have those properties. |
| 35 | return u_isIDPart(c); |
| 36 | #else |
| 37 | // This is incorrect, but if we don't have ICU, use this as fallback. |
| 38 | return false; |
| 39 | #endif // V8_I18N_SUPPORT |
| 40 | } |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 41 | } // namespace internal |
| 42 | } // namespace v8 |