Ignore:
Timestamp:
Nov 3, 2007, 11:18:31 PM (18 years ago)
Author:
Darin Adler
Message:
  • fix non-Mac builds; remove some more unused PCRE stuff
  • pcre/pcre_compile.c: (compile_branch): Removed branch chain and some unused ESC values. (compile_regex): Ditto. (jsRegExpCompile): Ditto.
  • pcre/pcre_exec.c: (match): Removed unused branch targets. Don't use macros any more. (jsRegExpExecute): More of the same.
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
  • JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
  • pcre/pcre.pri: Ditto.
  • pcre/MERGING: Removed.
  • pcre/pcre_fullinfo.c: Removed.
  • pcre/pcre_get.c: Removed.
  • pcre/pcre_internal.h:
  • pcre/ucp.h: Removed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_internal.h

    r27419 r27420  
    336336#define TRUE    1
    337337
    338 /* Escape items that are just an encoding of a particular data value. Note that
    339 ESC_n is defined as yet another macro, which is set in config.h to either \n
    340 (the default) or \r (which some people want). */
    341 
    342 #ifndef ESC_e
    343 #define ESC_e 27
    344 #endif
    345 
    346 #ifndef ESC_f
    347 #define ESC_f '\f'
    348 #endif
    349 
    350 #ifndef ESC_n
    351 #define ESC_n '\n'
    352 #endif
    353 
    354 #ifndef ESC_r
    355 #define ESC_r '\r'
    356 #endif
    357 
    358 /* We can't officially use ESC_t because it is a POSIX reserved identifier
    359 (presumably because of all the others like size_t). */
    360 
    361 #ifndef ESC_tee
    362 #define ESC_tee '\t'
    363 #endif
    364 
    365 #ifndef ESC_v
    366 #define ESC_v '\v'
    367 #endif
    368 
    369 /* Codes for different types of Unicode property */
    370 
    371 #define PT_ANY        0    /* Any property - matches all chars */
    372 #define PT_LAMP       1    /* L& - the union of Lu, Ll, Lt */
    373 #define PT_GC         2    /* General characteristic (e.g. L) */
    374 #define PT_PC         3    /* Particular characteristic (e.g. Lu) */
    375 #define PT_SC         4    /* Script (e.g. Han) */
    376 
    377338/* Flag bits and data types for the extended class (OP_XCLASS) for classes that
    378339contain UTF-8 characters with values greater than 255. */
     
    384345#define XCL_SINGLE    1    /* Single item (one multibyte char) follows */
    385346#define XCL_RANGE     2    /* A range (two multibyte chars) follows */
    386 #define XCL_PROP      3    /* Unicode property (2-byte property code follows) */
    387 #define XCL_NOTPROP   4    /* Unicode inverted property (ditto) */
    388347
    389348/* These are escaped items that aren't just an encoding of a particular data
     
    398357character, that code will have to change. */
    399358
    400 enum { ESC_A = 1, ESC_G, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W,
    401        ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E,
    402        ESC_Q, ESC_REF };
     359enum { ESC_B = 1, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W, ESC_w, ESC_REF };
    403360
    404361/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets
     
    413370  /* Values corresponding to backslashed metacharacters */
    414371
    415   xOP_SOD,            /* 1 Start of data: \A */
    416   xOP_SOM,            /* 2 Start of match (subject + offset): \G */
    417372  OP_NOT_WORD_BOUNDARY,  /*  3 \B */
    418373  OP_WORD_BOUNDARY,      /*  4 \b */
     
    423378  OP_NOT_WORDCHAR,       /*  9 \W */
    424379  OP_WORDCHAR,           /* 10 \w */
     380
    425381  OP_ANY,            /* 11 Match any character */
    426   xOP_ANYBYTE,        /* 12 Match any byte (\C); different to OP_ANY for UTF-8 */
    427   xOP_NOTPROP,        /* 13 \P (not Unicode property) */
    428   xOP_PROP,           /* 14 \p (Unicode property) */
    429   xOP_EXTUNI,         /* 15 \X (extended Unicode sequence */
    430   xOP_EODN,           /* 16 End of data or \n at end of data: \Z. */
    431   xOP_EOD,            /* 17 End of data: \z */
    432 
    433   xOP_OPT,            /* 18 Set runtime options */
     382
    434383  OP_CIRC,           /* 19 Start of line - varies with multiline switch */
    435384  OP_DOLL,           /* 20 End of line - varies with multiline switch */
     
    486435
    487436  OP_REF,            /* 62 Match a back reference */
    488   xOP_RECURSE,        /* 63 Match a numbered subpattern (possibly recursive) */
    489   xOP_CALLOUT,        /* 64 Call out to external function if provided */
    490437
    491438  OP_ALT,            /* 65 Start of alternation */
     
    498445  OP_ASSERT,         /* 69 Positive lookahead */
    499446  OP_ASSERT_NOT,     /* 70 Negative lookahead */
    500   xOP_ASSERTBACK,     /* 71 Positive lookbehind */
    501   xOP_ASSERTBACK_NOT, /* 72 Negative lookbehind */
    502   xOP_REVERSE,        /* 73 Move pointer back - used in lookbehind assertions */
    503447
    504448  /* ONCE and COND must come after the assertions, with ONCE first, as there's
     
    506450
    507451  OP_ONCE,           /* 74 Once matched, don't back up into the subpattern */
    508   xOP_COND,           /* 75 Conditional group */
    509   xOP_CREF,           /* 76 Used to hold an extraction string number (cond ref) */
    510452
    511453  OP_BRAZERO,        /* 77 These two must remain together and in this */
     
    533475
    534476
    535 /* This macro defines textual names for all the opcodes. These are used only
    536 for debugging. The macro is referenced only in pcre_printint.c. */
    537 
    538 #define OP_NAME_LIST \
    539   "End", "\\A", "\\G", "\\B", "\\b", "\\D", "\\d",                \
    540   "\\S", "\\s", "\\W", "\\w", "Any", "Anybyte",                   \
    541   "notprop", "prop", "extuni",                                    \
    542   "\\Z", "\\z",                                                   \
    543   "Opt", "^", "$", "char", "charnc", "not",                       \
    544   "*", "*?", "+", "+?", "?", "??", "{", "{", "{",                 \
    545   "*", "*?", "+", "+?", "?", "??", "{", "{", "{",                 \
    546   "*", "*?", "+", "+?", "?", "??", "{", "{", "{",                 \
    547   "*", "*?", "+", "+?", "?", "??", "{", "{",                      \
    548   "class", "nclass", "xclass", "Ref", "Recurse", "Callout",       \
    549   "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",     \
    550   "AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cond ref",\
    551   "Brazero", "Braminzero", "Branumber", "Bra"
    552 
    553 
    554477/* This macro defines the length of fixed length operations in the compiled
    555478regex. The lengths are used when searching for specific things, and also in the
     
    563486#define OP_LENGTHS \
    564487  1,                             /* End                                    */ \
    565   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \
    566   1, 1,                          /* Any, Anybyte                           */ \
    567   3, 3, 1,                       /* NOTPROP, PROP, EXTUNI                  */ \
    568   1, 1, 2, 1, 1,                 /* \Z, \z, Opt, ^, $                      */ \
     488  1, 1, 1, 1, 1, 1, 1, 1,        /* \B, \b, \D, \d, \S, \s, \W, \w         */ \
     489  1,                             /* Any                                    */ \
     490  1, 1,                          /* ^, $                                   */ \
    569491  2,                             /* Char  - the minimum length             */ \
    570492  2,                             /* Charnc  - the minimum length           */ \
     
    586508  0,                             /* XCLASS - variable length               */ \
    587509  3,                             /* REF                                    */ \
    588   1+LINK_SIZE,                   /* RECURSE                                */ \
    589   2+2*LINK_SIZE,                 /* CALLOUT                                */ \
    590510  1+LINK_SIZE,                   /* Alt                                    */ \
    591511  1+LINK_SIZE,                   /* Ket                                    */ \
     
    594514  1+LINK_SIZE,                   /* Assert                                 */ \
    595515  1+LINK_SIZE,                   /* Assert not                             */ \
    596   1+LINK_SIZE,                   /* Assert behind                          */ \
    597   1+LINK_SIZE,                   /* Assert behind not                      */ \
    598   1+LINK_SIZE,                   /* Reverse                                */ \
    599516  1+LINK_SIZE,                   /* Once                                   */ \
    600   1+LINK_SIZE,                   /* COND                                   */ \
    601   3,                             /* CREF                                   */ \
    602517  1, 1,                          /* BRAZERO, BRAMINZERO                    */ \
    603518  3,                             /* BRANUMBER                              */ \
    604519  1+LINK_SIZE                    /* BRA                                    */ \
    605520
    606 
    607 /* A magic value for OP_CREF to indicate the "in recursion" condition. */
    608 
    609 #define CREF_RECURSE  0xffff
    610521
    611522/* Error code numbers. They are given names so that they can more easily be
     
    643554  pcre_uint16 first_byte;
    644555  pcre_uint16 req_byte;
    645   pcre_uint16 name_table_offset;  /* Offset to name table that follows */
    646   pcre_uint16 name_entry_size;    /* Size of any name items */
    647   pcre_uint16 name_count;         /* Number of name items */
    648   pcre_uint16 ref_count;          /* Reference count */
    649 
    650   const unsigned char *tables;    /* Pointer to tables or NULL for std */
    651   const unsigned char *nullpad;   /* NULL padding */
    652556} real_pcre;
    653 
    654 /* The format of the block used to store data from pcre_study(). The same
    655 remark (see NOTE above) about extending this structure applies. */
    656 
    657 typedef struct pcre_study_data {
    658   pcre_uint32 size;               /* Total that was malloced */
    659   pcre_uint32 options;
    660   uschar start_bits[32];
    661 } pcre_study_data;
    662557
    663558/* Structure for passing "static" information around between the functions
     
    671566  const uschar *start_code;     /* The start of the compiled code */
    672567  const pcre_uchar *start_pattern;   /* The start of the pattern */
    673   uschar *name_table;           /* The name/number table */
    674   int  names_found;             /* Number of entries so far */
    675   int  name_entry_size;         /* Size of each entry */
    676568  int  top_backref;             /* Maximum back reference */
    677569  unsigned int backref_map;     /* Bitmap of low back refs */
    678570  int  req_varyopt;             /* "After variable item" flag for reqbyte */
    679571} compile_data;
    680 
    681 /* Structure for maintaining a chain of pointers to the currently incomplete
    682 branches, for testing for left recursion. */
    683 
    684 typedef struct branch_chain {
    685   struct branch_chain *outer;
    686   uschar *current;
    687 } branch_chain;
    688572
    689573/* When compiling in a mode that doesn't use recursive calls to match(),
     
    713597  USPTR  end_match_ptr;         /* Subject position at end match */
    714598  int    end_offset_top;        /* Highwater mark at end of match */
    715   struct heapframe *thisframe;  /* Used only when compiling for no recursion */
    716599  BOOL   multiline;
    717600  BOOL   caseless;
Note: See TracChangeset for help on using the changeset viewer.