OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CHAR_PREDICATES_H_ | 5 #ifndef V8_CHAR_PREDICATES_H_ |
6 #define V8_CHAR_PREDICATES_H_ | 6 #define V8_CHAR_PREDICATES_H_ |
7 | 7 |
| 8 #include "src/globals.h" |
8 #include "src/unicode.h" | 9 #include "src/unicode.h" |
9 | 10 |
10 namespace v8 { | 11 namespace v8 { |
11 namespace internal { | 12 namespace internal { |
12 | 13 |
13 // Unicode character predicates as defined by ECMA-262, 3rd, | 14 // Unicode character predicates as defined by ECMA-262, 3rd, |
14 // used for lexical analysis. | 15 // used for lexical analysis. |
15 | 16 |
16 inline int AsciiAlphaToLower(uc32 c); | 17 inline int AsciiAlphaToLower(uc32 c); |
17 inline bool IsCarriageReturn(uc32 c); | 18 inline bool IsCarriageReturn(uc32 c); |
18 inline bool IsLineFeed(uc32 c); | 19 inline bool IsLineFeed(uc32 c); |
19 inline bool IsAsciiIdentifier(uc32 c); | 20 inline bool IsAsciiIdentifier(uc32 c); |
20 inline bool IsAlphaNumeric(uc32 c); | 21 inline bool IsAlphaNumeric(uc32 c); |
21 inline bool IsDecimalDigit(uc32 c); | 22 inline bool IsDecimalDigit(uc32 c); |
22 inline bool IsHexDigit(uc32 c); | 23 inline bool IsHexDigit(uc32 c); |
23 inline bool IsOctalDigit(uc32 c); | 24 inline bool IsOctalDigit(uc32 c); |
24 inline bool IsBinaryDigit(uc32 c); | 25 inline bool IsBinaryDigit(uc32 c); |
25 inline bool IsRegExpWord(uc32 c); | 26 inline bool IsRegExpWord(uc32 c); |
26 inline bool IsRegExpNewline(uc32 c); | 27 inline bool IsRegExpNewline(uc32 c); |
27 | 28 |
28 | 29 struct V8_EXPORT_PRIVATE SupplementaryPlanes { |
29 struct SupplementaryPlanes { | |
30 static bool IsIDStart(uc32 c); | 30 static bool IsIDStart(uc32 c); |
31 static bool IsIDPart(uc32 c); | 31 static bool IsIDPart(uc32 c); |
32 }; | 32 }; |
33 | 33 |
34 | 34 |
35 // ES6 draft section 11.6 | 35 // ES6 draft section 11.6 |
36 // This includes '_', '$' and '\', and ID_Start according to | 36 // This includes '_', '$' and '\', and ID_Start according to |
37 // http://www.unicode.org/reports/tr31/, which consists of categories | 37 // http://www.unicode.org/reports/tr31/, which consists of categories |
38 // 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', but excluding properties | 38 // 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl', but excluding properties |
39 // 'Pattern_Syntax' or 'Pattern_White_Space'. | 39 // 'Pattern_Syntax' or 'Pattern_White_Space'. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 struct WhiteSpaceOrLineTerminator { | 76 struct WhiteSpaceOrLineTerminator { |
77 static inline bool Is(uc32 c) { | 77 static inline bool Is(uc32 c) { |
78 return WhiteSpace::Is(c) || unibrow::LineTerminator::Is(c); | 78 return WhiteSpace::Is(c) || unibrow::LineTerminator::Is(c); |
79 } | 79 } |
80 }; | 80 }; |
81 | 81 |
82 } // namespace internal | 82 } // namespace internal |
83 } // namespace v8 | 83 } // namespace v8 |
84 | 84 |
85 #endif // V8_CHAR_PREDICATES_H_ | 85 #endif // V8_CHAR_PREDICATES_H_ |
OLD | NEW |