| 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 Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 10 Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 #ifdef __GNUC__ | 55 #ifdef __GNUC__ |
| 56 #define USE_COMPUTED_GOTO_FOR_MATCH_RECURSION | 56 #define USE_COMPUTED_GOTO_FOR_MATCH_RECURSION |
| 57 //#define USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP | 57 //#define USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 /* Avoid warnings on Windows. */ | 60 /* Avoid warnings on Windows. */ |
| 61 #undef min | 61 #undef min |
| 62 #undef max | 62 #undef max |
| 63 | 63 |
| 64 namespace v8 { namespace jscre { |
| 65 |
| 64 #ifndef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION | 66 #ifndef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION |
| 65 typedef int ReturnLocation; | 67 typedef int ReturnLocation; |
| 66 #else | 68 #else |
| 67 typedef void* ReturnLocation; | 69 typedef void* ReturnLocation; |
| 68 #endif | 70 #endif |
| 69 | 71 |
| 70 /* Structure for building a chain of data for holding the values of | 72 /* Structure for building a chain of data for holding the values of |
| 71 the subject pointer at the start of each bracket, used to detect when | 73 the subject pointer at the start of each bracket, used to detect when |
| 72 an empty string has been matched by a bracket to break infinite loops. */ | 74 an empty string has been matched by a bracket to break infinite loops. */ |
| 73 struct BracketChainNode { | 75 struct BracketChainNode { |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2072 } while (!(re->options & IsAnchoredOption) && startMatch <= endSubject); | 2074 } while (!(re->options & IsAnchoredOption) && startMatch <= endSubject); |
| 2073 | 2075 |
| 2074 if (using_temporary_offsets) { | 2076 if (using_temporary_offsets) { |
| 2075 DPRINTF(("Freeing temporary memory\n")); | 2077 DPRINTF(("Freeing temporary memory\n")); |
| 2076 delete [] matchBlock.offsetVector; | 2078 delete [] matchBlock.offsetVector; |
| 2077 } | 2079 } |
| 2078 | 2080 |
| 2079 DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); | 2081 DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); |
| 2080 return JSRegExpErrorNoMatch; | 2082 return JSRegExpErrorNoMatch; |
| 2081 } | 2083 } |
| 2084 |
| 2085 } } // namespace v8::jscre |
| OLD | NEW |