Ignore:
Timestamp:
Nov 14, 2007, 5:17:31 PM (18 years ago)
Author:
[email protected]
Message:

2007-11-14 Eric Seidel <[email protected]>

Reviewed by Sam.

Give PCRE a (small) bath.
Fix some formating and break things off into separate functions
http://bugs.webkit.org/show_bug.cgi?id=15993

  • pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags): (printCompiledRegExp): (returnError): (jsRegExpCompile):
  • pcre/pcre_internal.h: (compile_data::compile_data):
File:
1 edited

Legend:

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

    r27730 r27802  
    544544} real_pcre;
    545545
     546/* Internal shared data tables. These are tables that are used by more than one
     547 of the exported public functions. They have to be "external" in the C sense,
     548 but are not part of the PCRE public API. The data for these tables is in the
     549 pcre_tables.c module. */
     550
     551#define _pcre_utf8_table1_size 6
     552
     553extern const int    _pcre_utf8_table1[6];
     554extern const int    _pcre_utf8_table2[6];
     555extern const int    _pcre_utf8_table3[6];
     556extern const uschar _pcre_utf8_table4[0x40];
     557
     558extern const uschar _pcre_default_tables[tables_length];
     559
    546560/* Structure for passing "static" information around between the functions
    547561doing the compiling, so that they are thread-safe. */
    548562
    549563typedef struct compile_data {
     564    compile_data() {
     565        lcc = _pcre_default_tables + lcc_offset;
     566        fcc = _pcre_default_tables + fcc_offset;
     567        cbits = _pcre_default_tables + cbits_offset;
     568        ctypes = _pcre_default_tables + ctypes_offset;
     569        start_code = 0;
     570        start_pattern = 0;
     571        top_backref = 0;
     572        backref_map = 0;
     573        req_varyopt = 0;
     574    }
     575   
    550576  const uschar *lcc;            /* Points to lower casing table */
    551577  const uschar *fcc;            /* Points to case-flipping table */
     
    559585} compile_data;
    560586
    561 /* Layout of the UCP type table that translates property names into types and
    562 codes. */
    563 
    564 typedef struct {
    565   const char *name;
    566   pcre_uint16 type;
    567   pcre_uint16 value;
    568 } ucp_type_table;
    569 
    570 /* Internal shared data tables. These are tables that are used by more than one
    571 of the exported public functions. They have to be "external" in the C sense,
    572 but are not part of the PCRE public API. The data for these tables is in the
    573 pcre_tables.c module. */
    574 
    575 #define _pcre_utf8_table1_size 6
    576 
    577 extern const int    _pcre_utf8_table1[6];
    578 extern const int    _pcre_utf8_table2[6];
    579 extern const int    _pcre_utf8_table3[6];
    580 extern const uschar _pcre_utf8_table4[0x40];
    581 
    582 extern const uschar _pcre_default_tables[tables_length];
    583 
    584587/* Internal shared functions. These are functions that are used by more than
    585588one of the exported public functions. They have to be "external" in the C
Note: See TracChangeset for help on using the changeset viewer.