/[pcre]/code/trunk/pcre_compile.c
ViewVC logotype

Diff of /code/trunk/pcre_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 180 by ph10, Wed Jun 13 10:59:18 2007 UTC revision 200 by ph10, Wed Aug 1 09:10:40 2007 UTC
# Line 42  POSSIBILITY OF SUCH DAMAGE. Line 42  POSSIBILITY OF SUCH DAMAGE.
42  supporting internal functions that are not used by other modules. */  supporting internal functions that are not used by other modules. */
43    
44    
45    #ifdef HAVE_CONFIG_H
46    #include <config.h>
47    #endif
48    
49  #define NLBLOCK cd             /* Block containing newline information */  #define NLBLOCK cd             /* Block containing newline information */
50  #define PSSTART start_pattern  /* Field containing processed string start */  #define PSSTART start_pattern  /* Field containing processed string start */
51  #define PSEND   end_pattern    /* Field containing processed string end */  #define PSEND   end_pattern    /* Field containing processed string end */
52    
   
53  #include "pcre_internal.h"  #include "pcre_internal.h"
54    
55    
# Line 120  static const short int escapes[] = { Line 123  static const short int escapes[] = {
123  /*  B8 */     0,     0,      0,       0,      0,   ']',    '=',    '-',  /*  B8 */     0,     0,      0,       0,      0,   ']',    '=',    '-',
124  /*  C0 */   '{',-ESC_A, -ESC_B,  -ESC_C, -ESC_D,-ESC_E,      0, -ESC_G,  /*  C0 */   '{',-ESC_A, -ESC_B,  -ESC_C, -ESC_D,-ESC_E,      0, -ESC_G,
125  /*  C8 */-ESC_H,     0,      0,       0,      0,     0,      0,      0,  /*  C8 */-ESC_H,     0,      0,       0,      0,     0,      0,      0,
126  /*  D0 */   '}',     0,      0,       0,      0,     0,      0, -ESC_P,  /*  D0 */   '}',     0, -ESC_K,       0,      0,     0,      0, -ESC_P,
127  /*  D8 */-ESC_Q,-ESC_R,      0,       0,      0,     0,      0,      0,  /*  D8 */-ESC_Q,-ESC_R,      0,       0,      0,     0,      0,      0,
128  /*  E0 */  '\\',     0, -ESC_S,       0,      0,-ESC_V, -ESC_W, -ESC_X,  /*  E0 */  '\\',     0, -ESC_S,       0,      0,-ESC_V, -ESC_W, -ESC_X,
129  /*  E8 */     0,-ESC_Z,      0,       0,      0,     0,      0,      0,  /*  E8 */     0,-ESC_Z,      0,       0,      0,     0,      0,      0,
# Line 701  if (c == '{') Line 704  if (c == '{')
704      *negptr = TRUE;      *negptr = TRUE;
705      ptr++;      ptr++;
706      }      }
707    for (i = 0; i < sizeof(name) - 1; i++)    for (i = 0; i < (int)sizeof(name) - 1; i++)
708      {      {
709      c = *(++ptr);      c = *(++ptr);
710      if (c == 0) goto ERROR_RETURN;      if (c == 0) goto ERROR_RETURN;
# Line 2026  switch(op_code) Line 2029  switch(op_code)
2029    
2030      case ESC_W:      case ESC_W:
2031      return item <= 127 && (cd->ctypes[item] & ctype_word) != 0;      return item <= 127 && (cd->ctypes[item] & ctype_word) != 0;
2032    
2033      case ESC_h:      case ESC_h:
2034      case ESC_H:      case ESC_H:
2035      switch(item)      switch(item)
# Line 2053  switch(op_code) Line 2056  switch(op_code)
2056        return -next != ESC_h;        return -next != ESC_h;
2057        default:        default:
2058        return -next == ESC_h;        return -next == ESC_h;
2059        }        }
2060    
2061      case ESC_v:      case ESC_v:
2062      case ESC_V:      case ESC_V:
2063      switch(item)      switch(item)
# Line 2069  switch(op_code) Line 2072  switch(op_code)
2072        return -next != ESC_v;        return -next != ESC_v;
2073        default:        default:
2074        return -next == ESC_v;        return -next == ESC_v;
2075        }        }
2076    
2077      default:      default:
2078      return FALSE;      return FALSE;
# Line 2093  switch(op_code) Line 2096  switch(op_code)
2096    
2097    case OP_NOT_HSPACE:    case OP_NOT_HSPACE:
2098    return next == -ESC_h;    return next == -ESC_h;
2099    
2100    /* Can't have \S in here because VT matches \S (Perl anomaly) */    /* Can't have \S in here because VT matches \S (Perl anomaly) */
2101    case OP_VSPACE:    case OP_VSPACE:
2102    return next == -ESC_V || next == -ESC_d || next == -ESC_w;    return next == -ESC_V || next == -ESC_d || next == -ESC_w;
2103    
2104    case OP_NOT_VSPACE:    case OP_NOT_VSPACE:
2105    return next == -ESC_v;    return next == -ESC_v;
2106    
2107    case OP_WORDCHAR:    case OP_WORDCHAR:
2108    return next == -ESC_W || next == -ESC_s || next == -ESC_h || next == -ESC_v;    return next == -ESC_W || next == -ESC_s || next == -ESC_h || next == -ESC_v;
2109    
2110    case OP_NOT_WORDCHAR:    case OP_NOT_WORDCHAR:
2111    return next == -ESC_w || next == -ESC_d;    return next == -ESC_w || next == -ESC_d;
2112    
2113    default:    default:
2114    return FALSE;    return FALSE;
2115    }    }

Legend:
Removed from v.180  
changed lines
  Added in v.200

  ViewVC Help
Powered by ViewVC 1.1.5