OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace v8 { | 33 namespace v8 { |
34 namespace internal { | 34 namespace internal { |
35 | 35 |
36 // Unicode character predicates as defined by ECMA-262, 3rd, | 36 // Unicode character predicates as defined by ECMA-262, 3rd, |
37 // used for lexical analysis. | 37 // used for lexical analysis. |
38 | 38 |
39 inline bool IsCarriageReturn(uc32 c); | 39 inline bool IsCarriageReturn(uc32 c); |
40 inline bool IsLineFeed(uc32 c); | 40 inline bool IsLineFeed(uc32 c); |
41 inline bool IsDecimalDigit(uc32 c); | 41 inline bool IsDecimalDigit(uc32 c); |
42 inline bool IsHexDigit(uc32 c); | 42 inline bool IsHexDigit(uc32 c); |
| 43 inline bool IsOctalDigit(uc32 c); |
| 44 inline bool IsBinaryDigit(uc32 c); |
43 inline bool IsRegExpWord(uc32 c); | 45 inline bool IsRegExpWord(uc32 c); |
44 inline bool IsRegExpNewline(uc32 c); | 46 inline bool IsRegExpNewline(uc32 c); |
45 | 47 |
46 struct IdentifierStart { | 48 struct IdentifierStart { |
47 static inline bool Is(uc32 c) { | 49 static inline bool Is(uc32 c) { |
48 switch (c) { | 50 switch (c) { |
49 case '$': case '_': case '\\': return true; | 51 case '$': case '_': case '\\': return true; |
50 default: return unibrow::Letter::Is(c); | 52 default: return unibrow::Letter::Is(c); |
51 } | 53 } |
52 } | 54 } |
53 }; | 55 }; |
54 | 56 |
55 | 57 |
56 struct IdentifierPart { | 58 struct IdentifierPart { |
57 static inline bool Is(uc32 c) { | 59 static inline bool Is(uc32 c) { |
58 return IdentifierStart::Is(c) | 60 return IdentifierStart::Is(c) |
59 || unibrow::Number::Is(c) | 61 || unibrow::Number::Is(c) |
60 || c == 0x200C // U+200C is Zero-Width Non-Joiner. | 62 || c == 0x200C // U+200C is Zero-Width Non-Joiner. |
61 || c == 0x200D // U+200D is Zero-Width Joiner. | 63 || c == 0x200D // U+200D is Zero-Width Joiner. |
62 || unibrow::CombiningMark::Is(c) | 64 || unibrow::CombiningMark::Is(c) |
63 || unibrow::ConnectorPunctuation::Is(c); | 65 || unibrow::ConnectorPunctuation::Is(c); |
64 } | 66 } |
65 }; | 67 }; |
66 | 68 |
67 } } // namespace v8::internal | 69 } } // namespace v8::internal |
68 | 70 |
69 #endif // V8_CHAR_PREDICATES_H_ | 71 #endif // V8_CHAR_PREDICATES_H_ |
OLD | NEW |