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_INL_H_ | 5 #ifndef V8_CHAR_PREDICATES_INL_H_ |
6 #define V8_CHAR_PREDICATES_INL_H_ | 6 #define V8_CHAR_PREDICATES_INL_H_ |
7 | 7 |
8 #include "src/char-predicates.h" | 8 #include "src/char-predicates.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 inline bool IsAsciiIdentifier(uc32 c) { | 38 inline bool IsAsciiIdentifier(uc32 c) { |
39 return IsAlphaNumeric(c) || c == '$' || c == '_'; | 39 return IsAlphaNumeric(c) || c == '$' || c == '_'; |
40 } | 40 } |
41 | 41 |
42 inline bool IsAlphaNumeric(uc32 c) { | 42 inline bool IsAlphaNumeric(uc32 c) { |
43 return IsInRange(AsciiAlphaToLower(c), 'a', 'z') || IsDecimalDigit(c); | 43 return IsInRange(AsciiAlphaToLower(c), 'a', 'z') || IsDecimalDigit(c); |
44 } | 44 } |
45 | 45 |
46 inline bool IsAlpha(uc32 c) { | |
47 return IsInRange(AsciiAlphaToLower(c), 'a', 'z'); | |
48 } | |
49 | |
50 inline bool IsDecimalDigit(uc32 c) { | 46 inline bool IsDecimalDigit(uc32 c) { |
51 // ECMA-262, 3rd, 7.8.3 (p 16) | 47 // ECMA-262, 3rd, 7.8.3 (p 16) |
52 return IsInRange(c, '0', '9'); | 48 return IsInRange(c, '0', '9'); |
53 } | 49 } |
54 | 50 |
55 | 51 |
56 inline bool IsHexDigit(uc32 c) { | 52 inline bool IsHexDigit(uc32 c) { |
57 // ECMA-262, 3rd, 7.6 (p 15) | 53 // ECMA-262, 3rd, 7.6 (p 15) |
58 return IsDecimalDigit(c) || IsInRange(AsciiAlphaToLower(c), 'a', 'f'); | 54 return IsDecimalDigit(c) || IsInRange(AsciiAlphaToLower(c), 'a', 'f'); |
59 } | 55 } |
(...skipping 26 matching lines...) Expand all Loading... |
86 default: | 82 default: |
87 return true; | 83 return true; |
88 } | 84 } |
89 } | 85 } |
90 | 86 |
91 | 87 |
92 } // namespace internal | 88 } // namespace internal |
93 } // namespace v8 | 89 } // namespace v8 |
94 | 90 |
95 #endif // V8_CHAR_PREDICATES_INL_H_ | 91 #endif // V8_CHAR_PREDICATES_INL_H_ |
OLD | NEW |