[webkit-changes] cvs commit: JavaScriptCore/pcre pcre_compile.c
pcre_exec.c pcre_internal.h
Darin
darin at opensource.apple.com
Mon Aug 15 09:28:23 PDT 2005
darin 05/08/15 09:28:23
Modified: JavaScriptCore.xcodeproj Tag: pcre-6-1-branch
project.pbxproj
pcre Tag: pcre-6-1-branch pcre_compile.c pcre_exec.c
pcre_internal.h
Log:
More PCRE hacking.
Revision Changes Path
No revision
No revision
1.5.4.2 +32 -2 JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Index: project.pbxproj
===================================================================
RCS file: /cvs/root/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- project.pbxproj 15 Aug 2005 16:12:35 -0000 1.5.4.1
+++ project.pbxproj 15 Aug 2005 16:28:22 -0000 1.5.4.2
@@ -31,6 +31,16 @@
65621E6E089E859700760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
65621E6F089E85D300760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
65621E70089E85D300760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 930754C008B0F68000AB3056 /* pcre_compile.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754BF08B0F68000AB3056 /* pcre_compile.c */; };
+ 930754C108B0F68000AB3056 /* pcre_compile.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754BF08B0F68000AB3056 /* pcre_compile.c */; };
+ 930754CF08B0F74600AB3056 /* pcre_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754CE08B0F74500AB3056 /* pcre_tables.c */; };
+ 930754D008B0F74600AB3056 /* pcre_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754CE08B0F74500AB3056 /* pcre_tables.c */; };
+ 930754D208B0F76300AB3056 /* pcre_globals.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754D108B0F76200AB3056 /* pcre_globals.c */; };
+ 930754D308B0F76300AB3056 /* pcre_globals.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754D108B0F76200AB3056 /* pcre_globals.c */; };
+ 930754E708B0F77700AB3056 /* pcre_fullinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754E608B0F77700AB3056 /* pcre_fullinfo.c */; };
+ 930754E808B0F77700AB3056 /* pcre_fullinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754E608B0F77700AB3056 /* pcre_fullinfo.c */; };
+ 930754EA08B0F78500AB3056 /* pcre_exec.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754E908B0F78500AB3056 /* pcre_exec.c */; };
+ 930754EB08B0F78500AB3056 /* pcre_exec.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754E908B0F78500AB3056 /* pcre_exec.c */; };
932F5B400822A1C700736975 /* array_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A84E0255597D01FF60F7 /* array_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B420822A1C700736975 /* collector.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8530255597D01FF60F7 /* collector.h */; settings = {ATTRIBUTES = (Private, ); }; };
932F5B430822A1C700736975 /* date_object.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8560255597D01FF60F7 /* date_object.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -467,6 +477,11 @@
70B16A270569A10900DB756D /* runtime_object.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = runtime_object.h; path = bindings/runtime_object.h; sourceTree = "<group>"; };
8442A376074175C2000AE2ED /* softlinking.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = softlinking.c; path = bindings/softlinking.c; sourceTree = "<group>"; };
84ABF1DE070B628C00A3AC05 /* npruntime_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = npruntime_impl.h; path = bindings/npruntime_impl.h; sourceTree = "<group>"; };
+ 930754BF08B0F68000AB3056 /* pcre_compile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pcre_compile.c; path = pcre/pcre_compile.c; sourceTree = "<group>"; };
+ 930754CE08B0F74500AB3056 /* pcre_tables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pcre_tables.c; path = pcre/pcre_tables.c; sourceTree = "<group>"; };
+ 930754D108B0F76200AB3056 /* pcre_globals.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pcre_globals.c; path = pcre/pcre_globals.c; sourceTree = "<group>"; };
+ 930754E608B0F77700AB3056 /* pcre_fullinfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pcre_fullinfo.c; path = pcre/pcre_fullinfo.c; sourceTree = "<group>"; };
+ 930754E908B0F78500AB3056 /* pcre_exec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pcre_exec.c; path = pcre/pcre_exec.c; sourceTree = "<group>"; };
931C6CEF038EE8DE008635CE /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = list.h; sourceTree = "<group>"; };
931C6CF0038EE8DE008635CE /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = list.cpp; sourceTree = "<group>"; };
9322A00306C341D3009067BB /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
@@ -771,9 +786,14 @@
65417203039E01F90058BFEB /* pcre */ = {
isa = PBXGroup;
children = (
- 6541720E039E08B90058BFEB /* dftables.c */,
65417217039E0B280058BFEB /* pcre-config.h */,
6541720F039E08B90058BFEB /* pcre.h */,
+ 930754BF08B0F68000AB3056 /* pcre_compile.c */,
+ 930754E908B0F78500AB3056 /* pcre_exec.c */,
+ 930754E608B0F77700AB3056 /* pcre_fullinfo.c */,
+ 930754D108B0F76200AB3056 /* pcre_globals.c */,
+ 930754CE08B0F74500AB3056 /* pcre_tables.c */,
+ 6541720E039E08B90058BFEB /* dftables.c */,
);
name = pcre;
sourceTree = "<group>";
@@ -1230,7 +1250,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"$BUILT_PRODUCTS_DIR/dftables\" > \"$DERIVED_FILE_DIR/chartables.c\"";
+ shellScript = "\"$BUILT_PRODUCTS_DIR/dftables\" \"$DERIVED_FILE_DIR/chartables.c\"";
};
93F197EC08245819001E9ABC /* lexer.lut.h */ = {
isa = PBXShellScriptBuildPhase;
@@ -1520,6 +1540,11 @@
932F5BD00822A1C700736975 /* softlinking.c in Sources */,
932F5BD10822A1C700736975 /* fast_malloc.cpp in Sources */,
65621E6D089E859700760F35 /* property_slot.cpp in Sources */,
+ 930754C108B0F68000AB3056 /* pcre_compile.c in Sources */,
+ 930754D008B0F74600AB3056 /* pcre_tables.c in Sources */,
+ 930754D308B0F76300AB3056 /* pcre_globals.c in Sources */,
+ 930754E808B0F77700AB3056 /* pcre_fullinfo.c in Sources */,
+ 930754EB08B0F78500AB3056 /* pcre_exec.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1604,6 +1629,11 @@
A85D827F087B2822006A9172 /* softlinking.c in Sources */,
A85D8280087B2822006A9172 /* fast_malloc.cpp in Sources */,
65621E6F089E85D300760F35 /* property_slot.cpp in Sources */,
+ 930754C008B0F68000AB3056 /* pcre_compile.c in Sources */,
+ 930754CF08B0F74600AB3056 /* pcre_tables.c in Sources */,
+ 930754D208B0F76300AB3056 /* pcre_globals.c in Sources */,
+ 930754E708B0F77700AB3056 /* pcre_fullinfo.c in Sources */,
+ 930754EA08B0F78500AB3056 /* pcre_exec.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
No revision
No revision
1.1.2.2 +3 -3 JavaScriptCore/pcre/Attic/pcre_compile.c
Index: pcre_compile.c
===================================================================
RCS file: /cvs/root/JavaScriptCore/pcre/Attic/pcre_compile.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- pcre_compile.c 15 Aug 2005 16:09:54 -0000 1.1.2.1
+++ pcre_compile.c 15 Aug 2005 16:28:22 -0000 1.1.2.2
@@ -111,7 +111,7 @@
terminated by a zero length entry. The first three must be alpha, upper, lower,
as this is assumed for handling case independence. */
-static const char * const const posix_names[] = {
+static const char * const posix_names[] = {
"alpha", "lower", "upper",
"alnum", "ascii", "blank", "cntrl", "digit", "graph",
"print", "punct", "space", "word", "xdigit" };
@@ -1352,11 +1352,11 @@
return TRUE;
}
-#define STREQUAL(str1, len, str2) strequal((str), (len), (str2))
+#define STREQUAL(str1, len, str2) strequal((str1), (len), (str2))
#else
-#define STREQUAL(str1, len, str2) (strncmp((const char *)(str), (str2), (len)) == 0)
+#define STREQUAL(str1, len, str2) (strncmp((const char *)(str1), (str2), (len)) == 0)
#endif
1.1.2.1 +24 -22 JavaScriptCore/pcre/Attic/pcre_exec.c
Index: pcre_exec.c
===================================================================
RCS file: /cvs/root/JavaScriptCore/pcre/Attic/pcre_exec.c,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- pcre_exec.c 12 Aug 2005 22:13:26 -0000 1.1
+++ pcre_exec.c 15 Aug 2005 16:28:22 -0000 1.1.2.1
@@ -54,7 +54,7 @@
typedef struct eptrblock {
struct eptrblock *epb_prev;
- const uschar *epb_saved_eptr;
+ const ichar *epb_saved_eptr;
} eptrblock;
/* Flag bits for the match() function */
@@ -99,7 +99,7 @@
*/
static void
-pchars(const uschar *p, int length, BOOL is_subject, match_data *md)
+pchars(const ichar *p, int length, BOOL is_subject, match_data *md)
{
int c;
if (is_subject && length > md->end_subject - p) length = md->end_subject - p;
@@ -128,10 +128,10 @@
*/
static BOOL
-match_ref(int offset, register const uschar *eptr, int length, match_data *md,
+match_ref(int offset, register const ichar *eptr, int length, match_data *md,
unsigned long int ims)
{
-const uschar *p = md->start_subject + md->offset_vector[offset];
+const ichar *p = md->start_subject + md->offset_vector[offset];
#ifdef DEBUG
if (eptr >= md->end_subject)
@@ -250,7 +250,7 @@
/* Function arguments that may change */
- const uschar *Xeptr;
+ const ichar *Xeptr;
const uschar *Xecode;
int Xoffset_top;
long int Xims;
@@ -263,9 +263,9 @@
const uschar *Xcharptr;
const uschar *Xdata;
const uschar *Xnext;
- const uschar *Xpp;
+ const ichar *Xpp;
const uschar *Xprev;
- const uschar *Xsaved_eptr;
+ const ichar *Xsaved_eptr;
recursion_info Xnew_recursive;
@@ -351,7 +351,7 @@
*/
static int
-match(REGISTER const uschar *eptr, REGISTER const uschar *ecode,
+match(REGISTER const ichar *eptr, REGISTER const uschar *ecode,
int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,
int flags)
{
@@ -458,9 +458,9 @@
const uschar *callpat; /* them within each of those blocks. */
const uschar *data; /* However, in order to accommodate the */
const uschar *next; /* version of this code that uses an */
-const uschar *pp; /* external "stack" implemented on the */
+const ichar *pp; /* external "stack" implemented on the */
const uschar *prev; /* heap, it is easier to declare them */
-const uschar *saved_eptr; /* all here, so the declarations can */
+const ichar *saved_eptr; /* all here, so the declarations can */
/* be cut out in a block. The only */
recursion_info new_recursive; /* declarations within blocks below are */
/* for variables that do not have to */
@@ -800,7 +800,7 @@
cb.version = 1; /* Version 1 of the callout block */
cb.callout_number = ecode[1];
cb.offset_vector = md->offset_vector;
- cb.subject = (const char *)md->start_subject;
+ cb.subject = (const pcre_char *)md->start_subject;
cb.subject_length = md->end_subject - md->start_subject;
cb.start_match = md->start_match - md->start_subject;
cb.current_position = eptr - md->start_subject;
@@ -1213,7 +1213,7 @@
{
if (eptr == md->start_subject) prev_is_word = FALSE; else
{
- const uschar *lastptr = eptr - 1;
+ const ichar *lastptr = eptr - 1;
while((*lastptr & 0xc0) == 0x80) lastptr--;
GETCHAR(c, lastptr);
prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
@@ -3202,7 +3202,7 @@
EXPORT int
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data,
- const char *subject, int length, int start_offset, int options, int *offsets,
+ const pcre_char *subject, int length, int start_offset, int options, int *offsets,
int offsetcount)
{
int rc, resetcount, ocount;
@@ -3219,9 +3219,9 @@
match_data match_block;
const uschar *tables;
const uschar *start_bits = NULL;
-const uschar *start_match = (const uschar *)subject + start_offset;
-const uschar *end_subject;
-const uschar *req_byte_ptr = start_match - 1;
+const ichar *start_match = (const ichar *)subject + start_offset;
+const ichar *end_subject;
+const ichar *req_byte_ptr = start_match - 1;
pcre_study_data internal_study;
const pcre_study_data *study;
@@ -3289,7 +3289,7 @@
match_block.start_code = (const uschar *)external_re + re->name_table_offset +
re->name_count * re->name_entry_size;
-match_block.start_subject = (const uschar *)subject;
+match_block.start_subject = (const ichar *)subject;
match_block.start_offset = start_offset;
match_block.end_subject = match_block.start_subject + length;
end_subject = match_block.end_subject;
@@ -3317,14 +3317,15 @@
/* Check a UTF-8 string if required. Unfortunately there's no way of passing
back the character offset. */
+#if !PCRE_UTF16
#ifdef SUPPORT_UTF8
if (match_block.utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
{
- if (_pcre_valid_utf8((uschar *)subject, length) >= 0)
+ if (_pcre_valid_utf8((ichar *)subject, length) >= 0)
return PCRE_ERROR_BADUTF8;
if (start_offset > 0 && start_offset < length)
{
- int tb = ((uschar *)subject)[start_offset];
+ int tb = ((ichar *)subject)[start_offset];
if (tb > 127)
{
tb &= 0xc0;
@@ -3333,6 +3334,7 @@
}
}
#endif
+#endif
/* The ims options can vary during the matching as a result of the presence
of (?ims) items in the pattern. They are kept in a local variable so that
@@ -3415,7 +3417,7 @@
do
{
- const uschar *save_end_subject = end_subject;
+ const ichar *save_end_subject = end_subject;
/* Reset the maximum number of extractions we might see. */
@@ -3434,7 +3436,7 @@
if (firstline)
{
- const uschar *t = start_match;
+ const ichar *t = start_match;
while (t < save_end_subject && *t != '\n') t++;
end_subject = t;
}
@@ -3504,7 +3506,7 @@
end_subject - start_match < REQ_BYTE_MAX &&
!match_block.partial)
{
- register const uschar *p = start_match + ((first_byte >= 0)? 1 : 0);
+ register const ichar *p = start_match + ((first_byte >= 0)? 1 : 0);
/* We don't need to repeat the search if we haven't yet reached the
place we found it at last time. */
1.1.2.2 +4 -6 JavaScriptCore/pcre/Attic/pcre_internal.h
Index: pcre_internal.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/pcre/Attic/pcre_internal.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- pcre_internal.h 15 Aug 2005 16:09:54 -0000 1.1.2.1
+++ pcre_internal.h 15 Aug 2005 16:28:22 -0000 1.1.2.2
@@ -300,12 +300,10 @@
#define GETCHARLEN(c, eptr, len) \
c = eptr[0]; \
- if (!IS_LEADING_SURROGATE(c)) \
- len = 1; \
- else \
+ if (IS_LEADING_SURROGATE(c)) \
{ \
c = DECODE_SURROGATE_PAIR(c, eptr[1]); \
- len = 2; \
+ ++len; \
}
#define ISMBSTARTCHAR(c) IS_LEADING_SURROGATE(c)
@@ -817,7 +815,7 @@
const uschar *cbits; /* Points to character type table */
const uschar *ctypes; /* Points to table of type maps */
const uschar *start_code; /* The start of the compiled code */
- const uschar *start_pattern; /* The start of the pattern */
+ const ichar *start_pattern; /* The start of the pattern */
uschar *name_table; /* The name/number table */
int names_found; /* Number of entries so far */
int name_entry_size; /* Size of each entry */
@@ -842,7 +840,7 @@
struct recursion_info *prevrec; /* Previous recursion record (or NULL) */
int group_num; /* Number of group that was called */
const uschar *after_call; /* "Return value": points after the call in the expr */
- const uschar *save_start; /* Old value of md->start_match */
+ const ichar *save_start; /* Old value of md->start_match */
int *offset_save; /* Pointer to start of saved offsets */
int saved_max; /* Number of saved offsets */
} recursion_info;
More information about the webkit-changes
mailing list