OLD | NEW |
1 /* This is JavaScriptCore's variant of the PCRE library. While this library | 1 /* This is JavaScriptCore's variant of the PCRE library. While this library |
2 started out as a copy of PCRE, many of the features of PCRE have been | 2 started out as a copy of PCRE, many of the features of PCRE have been |
3 removed. This library now supports only the regular expression features | 3 removed. This library now supports only the regular expression features |
4 required by the JavaScript language specification, and has only the functions | 4 required by the JavaScript language specification, and has only the functions |
5 needed by JavaScriptCore and the rest of WebKit. | 5 needed by JavaScriptCore and the rest of WebKit. |
6 | 6 |
7 Originally written by Philip Hazel | 7 Originally written by Philip Hazel |
8 Copyright (c) 1997-2006 University of Cambridge | 8 Copyright (c) 1997-2006 University of Cambridge |
9 Copyright (C) 2002, 2004, 2006, 2007 Apple Inc. All rights reserved. | 9 Copyright (C) 2002, 2004, 2006, 2007 Apple Inc. All rights reserved. |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 | 40 |
41 /* This module contains code for searching the table of Unicode character | 41 /* This module contains code for searching the table of Unicode character |
42 properties. */ | 42 properties. */ |
43 | 43 |
44 #include "pcre_internal.h" | 44 #include "pcre_internal.h" |
45 | 45 |
46 #include "ucpinternal.h" /* Internal table details */ | 46 #include "ucpinternal.h" /* Internal table details */ |
47 #include "ucptable.cpp" /* The table itself */ | 47 #include "ucptable.cpp" /* The table itself */ |
48 | 48 |
| 49 namespace v8 { namespace jscre { |
| 50 |
49 /************************************************* | 51 /************************************************* |
50 * Search table and return other case * | 52 * Search table and return other case * |
51 *************************************************/ | 53 *************************************************/ |
52 | 54 |
53 /* If the given character is a letter, and there is another case for the | 55 /* If the given character is a letter, and there is another case for the |
54 letter, return the other case. Otherwise, return -1. | 56 letter, return the other case. Otherwise, return -1. |
55 | 57 |
56 Arguments: | 58 Arguments: |
57 c the character value | 59 c the character value |
58 | 60 |
(...skipping 30 matching lines...) Expand all Loading... |
89 the other case if there is one, else -1. */ | 91 the other case if there is one, else -1. */ |
90 | 92 |
91 if (ucp_table[mid].f0 & f0_rangeflag) | 93 if (ucp_table[mid].f0 & f0_rangeflag) |
92 return -1; | 94 return -1; |
93 | 95 |
94 int offset = ucp_table[mid].f1 & f1_casemask; | 96 int offset = ucp_table[mid].f1 & f1_casemask; |
95 if (offset & f1_caseneg) | 97 if (offset & f1_caseneg) |
96 offset |= f1_caseneg; | 98 offset |= f1_caseneg; |
97 return !offset ? -1 : c + offset; | 99 return !offset ? -1 : c + offset; |
98 } | 100 } |
| 101 |
| 102 } } // namespace v8::jscre |
OLD | NEW |