Changeset 27686 in webkit for trunk/JavaScriptCore/pcre/pcre_maketables.cpp
- Timestamp:
- Nov 11, 2007, 10:56:13 AM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_maketables.cpp
r27681 r27686 1 /************************************************* 2 * Perl-Compatible Regular Expressions * 3 *************************************************/ 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 3 removed. This library now supports only the regular expression features 4 required by the JavaScript language specification, and has only the functions 5 needed by JavaScriptCore and the rest of WebKit. 4 6 5 /* PCRE is a library of functions to support regular expressions whose syntax 6 and semantics are as close as possible to those of the Perl 5 language. 7 8 Written by Philip Hazel 7 Originally written by Philip Hazel 9 8 Copyright (c) 1997-2006 University of Cambridge 9 Copyright (C) 2002, 2004, 2006, 2007 Apple Inc. All rights reserved. 10 10 11 11 ----------------------------------------------------------------------------- … … 59 59 int i; 60 60 61 #ifndef DFTABLES62 yield = (unsigned char*)(pcre_malloc)(tables_length);63 #else64 61 yield = (unsigned char*)malloc(tables_length); 65 #endif66 62 67 63 if (yield == NULL) return NULL; … … 86 82 87 83 memset(p, 0, cbit_length); 84 for (i = '0'; i <= '9'; i++) 85 p[cbit_digit + i / 8] |= 1 << (i & 7); 86 p[cbit_word + '_' / 8] |= 1 << ('_' & 7); 88 87 for (i = 0; i < 128; i++) 89 88 { 90 if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7); 91 if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7); 92 if (i == '_') p[cbit_word + i/8] |= 1 << (i&7); 93 if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7); 89 if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i & 7); 90 if (isspace(i)) p[cbit_space + i/8] |= 1 << (i & 7); 94 91 } 95 92 p += cbit_length; … … 103 100 int x = 0; 104 101 if (isspace(i)) x += ctype_space; 105 if (isdigit(i)) x += ctype_digit;106 102 if (isxdigit(i)) x += ctype_xdigit; 107 103 if (isalnum(i) || i == '_') x += ctype_word;
Note:
See TracChangeset
for help on using the changeset viewer.