blob: 66508375a10957454becdfaeeb7a89fc817c9a45 [file] [log] [blame]
Emily Bernierd0a1eb72015-03-24 16:35:39 -04001// 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
12namespace v8 {
13namespace internal {
14
15bool 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
29bool 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 Murdoch4a90d5f2016-03-22 12:00:34 +000041} // namespace internal
42} // namespace v8