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 12 matching lines...) Expand all Loading... |
23 return c == 0x000D; | 23 return c == 0x000D; |
24 } | 24 } |
25 | 25 |
26 | 26 |
27 inline bool IsLineFeed(uc32 c) { | 27 inline bool IsLineFeed(uc32 c) { |
28 return c == 0x000A; | 28 return c == 0x000A; |
29 } | 29 } |
30 | 30 |
31 | 31 |
32 inline bool IsInRange(int value, int lower_limit, int higher_limit) { | 32 inline bool IsInRange(int value, int lower_limit, int higher_limit) { |
33 ASSERT(lower_limit <= higher_limit); | 33 DCHECK(lower_limit <= higher_limit); |
34 return static_cast<unsigned int>(value - lower_limit) <= | 34 return static_cast<unsigned int>(value - lower_limit) <= |
35 static_cast<unsigned int>(higher_limit - lower_limit); | 35 static_cast<unsigned int>(higher_limit - lower_limit); |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 inline bool IsDecimalDigit(uc32 c) { | 39 inline bool IsDecimalDigit(uc32 c) { |
40 // ECMA-262, 3rd, 7.8.3 (p 16) | 40 // ECMA-262, 3rd, 7.8.3 (p 16) |
41 return IsInRange(c, '0', '9'); | 41 return IsInRange(c, '0', '9'); |
42 } | 42 } |
43 | 43 |
(...skipping 30 matching lines...) Expand all Loading... |
74 return false; | 74 return false; |
75 default: | 75 default: |
76 return true; | 76 return true; |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 } } // namespace v8::internal | 81 } } // namespace v8::internal |
82 | 82 |
83 #endif // V8_CHAR_PREDICATES_INL_H_ | 83 #endif // V8_CHAR_PREDICATES_INL_H_ |
OLD | NEW |