| 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_UNICODE_H_ | 5 #ifndef V8_UNICODE_H_ |
| 6 #define V8_UNICODE_H_ | 6 #define V8_UNICODE_H_ |
| 7 | 7 |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/utils.h" | 10 #include "src/utils.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // This method checks for: | 173 // This method checks for: |
| 174 // - valid utf-8 endcoding (e.g. no over-long encodings), | 174 // - valid utf-8 endcoding (e.g. no over-long encodings), |
| 175 // - absence of surrogates, | 175 // - absence of surrogates, |
| 176 // - valid code point range. | 176 // - valid code point range. |
| 177 static bool ValidateEncoding(const byte* str, size_t length); | 177 static bool ValidateEncoding(const byte* str, size_t length); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 struct Uppercase { | 180 struct Uppercase { |
| 181 static bool Is(uchar c); | 181 static bool Is(uchar c); |
| 182 }; | 182 }; |
| 183 struct Lowercase { | |
| 184 static bool Is(uchar c); | |
| 185 }; | |
| 186 struct Letter { | 183 struct Letter { |
| 187 static bool Is(uchar c); | 184 static bool Is(uchar c); |
| 188 }; | 185 }; |
| 186 #ifndef V8_INTL_SUPPORT |
| 189 struct V8_EXPORT_PRIVATE ID_Start { | 187 struct V8_EXPORT_PRIVATE ID_Start { |
| 190 static bool Is(uchar c); | 188 static bool Is(uchar c); |
| 191 }; | 189 }; |
| 192 struct V8_EXPORT_PRIVATE ID_Continue { | 190 struct V8_EXPORT_PRIVATE ID_Continue { |
| 193 static bool Is(uchar c); | 191 static bool Is(uchar c); |
| 194 }; | 192 }; |
| 195 struct V8_EXPORT_PRIVATE WhiteSpace { | 193 struct V8_EXPORT_PRIVATE WhiteSpace { |
| 196 static bool Is(uchar c); | 194 static bool Is(uchar c); |
| 197 }; | 195 }; |
| 196 #endif // !V8_INTL_SUPPORT |
| 198 struct V8_EXPORT_PRIVATE LineTerminator { | 197 struct V8_EXPORT_PRIVATE LineTerminator { |
| 199 static bool Is(uchar c); | 198 static bool Is(uchar c); |
| 200 }; | 199 }; |
| 201 struct ToLowercase { | 200 struct ToLowercase { |
| 202 static const int kMaxWidth = 3; | 201 static const int kMaxWidth = 3; |
| 203 static const bool kIsToLower = true; | 202 static const bool kIsToLower = true; |
| 204 static int Convert(uchar c, | 203 static int Convert(uchar c, |
| 205 uchar n, | 204 uchar n, |
| 206 uchar* result, | 205 uchar* result, |
| 207 bool* allow_caching_ptr); | 206 bool* allow_caching_ptr); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 232 static const int kMaxWidth = 1; | 231 static const int kMaxWidth = 1; |
| 233 static int Convert(uchar c, | 232 static int Convert(uchar c, |
| 234 uchar n, | 233 uchar n, |
| 235 uchar* result, | 234 uchar* result, |
| 236 bool* allow_caching_ptr); | 235 bool* allow_caching_ptr); |
| 237 }; | 236 }; |
| 238 | 237 |
| 239 } // namespace unibrow | 238 } // namespace unibrow |
| 240 | 239 |
| 241 #endif // V8_UNICODE_H_ | 240 #endif // V8_UNICODE_H_ |
| OLD | NEW |