| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 *************************************************/ | 58 *************************************************/ |
| 59 | 59 |
| 60 /* Maximum number of items on the nested bracket stacks at compile time. This | 60 /* Maximum number of items on the nested bracket stacks at compile time. This |
| 61 applies to the nesting of all kinds of parentheses. It does not limit | 61 applies to the nesting of all kinds of parentheses. It does not limit |
| 62 un-nested, non-capturing parentheses. This number can be made bigger if | 62 un-nested, non-capturing parentheses. This number can be made bigger if |
| 63 necessary - it is used to dimension one int and one unsigned char vector at | 63 necessary - it is used to dimension one int and one unsigned char vector at |
| 64 compile time. */ | 64 compile time. */ |
| 65 | 65 |
| 66 #define BRASTACK_SIZE 200 | 66 #define BRASTACK_SIZE 200 |
| 67 | 67 |
| 68 namespace v8 { namespace jscre { |
| 69 |
| 68 /* Table for handling escaped characters in the range '0'-'z'. Positive returns | 70 /* Table for handling escaped characters in the range '0'-'z'. Positive returns |
| 69 are simple data values; negative values are for special things like \d and so | 71 are simple data values; negative values are for special things like \d and so |
| 70 on. Zero means further processing is needed (for things like \x), or the escape | 72 on. Zero means further processing is needed (for things like \x), or the escape |
| 71 is invalid. */ | 73 is invalid. */ |
| 72 | 74 |
| 73 static const short escapes[] = { | 75 static const short escapes[] = { |
| 74 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */ | 76 0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */ |
| 75 0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */ | 77 0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */ |
| 76 '@', 0, -ESC_B, 0, -ESC_D, 0, 0, 0, /* @ - G */ | 78 '@', 0, -ESC_B, 0, -ESC_D, 0, 0, 0, /* @ - G */ |
| 77 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ | 79 0, 0, 0, 0, 0, 0, 0, 0, /* H - O */ |
| (...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 | 2666 |
| 2665 if (numSubpatterns) | 2667 if (numSubpatterns) |
| 2666 *numSubpatterns = re->top_bracket; | 2668 *numSubpatterns = re->top_bracket; |
| 2667 return re; | 2669 return re; |
| 2668 } | 2670 } |
| 2669 | 2671 |
| 2670 void jsRegExpFree(JSRegExp* re, free_t* free_function) | 2672 void jsRegExpFree(JSRegExp* re, free_t* free_function) |
| 2671 { | 2673 { |
| 2672 (*free_function)(reinterpret_cast<void*>(re)); | 2674 (*free_function)(reinterpret_cast<void*>(re)); |
| 2673 } | 2675 } |
| 2676 |
| 2677 } } // namespace v8::jscre |
| OLD | NEW |