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 |
46 inline bool IsDecimalDigit(uc32 c) { | 50 inline bool IsDecimalDigit(uc32 c) { |
47 // ECMA-262, 3rd, 7.8.3 (p 16) | 51 // ECMA-262, 3rd, 7.8.3 (p 16) |
48 return IsInRange(c, '0', '9'); | 52 return IsInRange(c, '0', '9'); |
49 } | 53 } |
50 | 54 |
51 | 55 |
52 inline bool IsHexDigit(uc32 c) { | 56 inline bool IsHexDigit(uc32 c) { |
53 // ECMA-262, 3rd, 7.6 (p 15) | 57 // ECMA-262, 3rd, 7.6 (p 15) |
54 return IsDecimalDigit(c) || IsInRange(AsciiAlphaToLower(c), 'a', 'f'); | 58 return IsDecimalDigit(c) || IsInRange(AsciiAlphaToLower(c), 'a', 'f'); |
55 } | 59 } |
(...skipping 26 matching lines...) Expand all Loading... |
82 default: | 86 default: |
83 return true; | 87 return true; |
84 } | 88 } |
85 } | 89 } |
86 | 90 |
87 | 91 |
88 } // namespace internal | 92 } // namespace internal |
89 } // namespace v8 | 93 } // namespace v8 |
90 | 94 |
91 #endif // V8_CHAR_PREDICATES_INL_H_ | 95 #endif // V8_CHAR_PREDICATES_INL_H_ |
OLD | NEW |