/[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 210 by ph10, Wed Aug 8 14:24:50 2007 UTC revision 211 by ph10, Thu Aug 9 09:52:43 2007 UTC
# Line 146  typedef struct verbitem { Line 146  typedef struct verbitem {
146    const char *name;    const char *name;
147    int   len;    int   len;
148    int   op;    int   op;
149  } verbitem;  } verbitem;
150    
151  static verbitem verbs[] = {  static verbitem verbs[] = {
152    { "ACCEPT", 6, OP_ACCEPT },    { "ACCEPT", 6, OP_ACCEPT },
153    { "COMMIT", 6, OP_COMMIT },    { "COMMIT", 6, OP_COMMIT },
154    { "F",      1, OP_FAIL },    { "F",      1, OP_FAIL },
155    { "FAIL",   4, OP_FAIL },    { "FAIL",   4, OP_FAIL },
156    { "PRUNE",  5, OP_PRUNE },    { "PRUNE",  5, OP_PRUNE },
157    { "SKIP",   4, OP_SKIP  },    { "SKIP",   4, OP_SKIP  },
158    { "THEN",   4, OP_THEN  }    { "THEN",   4, OP_THEN  }
# Line 281  static const char *error_texts[] = { Line 281  static const char *error_texts[] = {
281    "\\g is not followed by a braced name or an optionally braced non-zero number",    "\\g is not followed by a braced name or an optionally braced non-zero number",
282    "(?+ or (?- or (?(+ or (?(- must be followed by a non-zero number",    "(?+ or (?- or (?(+ or (?(- must be followed by a non-zero number",
283    "(*VERB) with an argument is not supported",    "(*VERB) with an argument is not supported",
284    /* 60 */    /* 60 */
285    "(*VERB) not recognized"    "(*VERB) not recognized"
286  };  };
287    
288    
# Line 3892  for (;; ptr++) Line 3892  for (;; ptr++)
3892      bravalue = OP_CBRA;      bravalue = OP_CBRA;
3893      save_hwm = cd->hwm;      save_hwm = cd->hwm;
3894      reset_bracount = FALSE;      reset_bracount = FALSE;
3895    
3896      /* First deal with various "verbs" that can be introduced by '*'. */      /* First deal with various "verbs" that can be introduced by '*'. */
3897    
3898      if (*(++ptr) == '*' && (cd->ctypes[ptr[1]] & ctype_letter) != 0)      if (*(++ptr) == '*' && (cd->ctypes[ptr[1]] & ctype_letter) != 0)
3899        {        {
3900        int i, namelen;        int i, namelen;
3901        const uschar *name = ++ptr;        const uschar *name = ++ptr;
3902        previous = NULL;        previous = NULL;
3903        while ((cd->ctypes[*++ptr] & ctype_letter) != 0);        while ((cd->ctypes[*++ptr] & ctype_letter) != 0);
3904        if (*ptr == ':')        if (*ptr == ':')
3905          {          {
3906          *errorcodeptr = ERR59;   /* Not supported */          *errorcodeptr = ERR59;   /* Not supported */
3907          goto FAILED;          goto FAILED;
3908          }          }
3909        if (*ptr != ')')        if (*ptr != ')')
3910          {          {
3911          *errorcodeptr = ERR60;          *errorcodeptr = ERR60;
3912          goto FAILED;          goto FAILED;
3913          }          }
3914        namelen = ptr - name;        namelen = ptr - name;
3915        for (i = 0; i < verbcount; i++)        for (i = 0; i < verbcount; i++)
3916          {          {
3917          if (namelen == verbs[i].len &&          if (namelen == verbs[i].len &&
3918              strncmp((char *)name, verbs[i].name, namelen) == 0)              strncmp((char *)name, verbs[i].name, namelen) == 0)
3919            {            {
3920            *code = verbs[i].op;            *code = verbs[i].op;
3921            if (*code++ == OP_ACCEPT) cd->had_accept = TRUE;            if (*code++ == OP_ACCEPT) cd->had_accept = TRUE;
3922            break;            break;
3923            }            }
3924          }          }
3925        if (i < verbcount) continue;        if (i < verbcount) continue;
3926        *errorcodeptr = ERR60;        *errorcodeptr = ERR60;
3927        goto FAILED;        goto FAILED;
3928        }        }
3929    
3930      /* Deal with the extended parentheses; all are introduced by '?', and the      /* Deal with the extended parentheses; all are introduced by '?', and the
3931      appearance of any of them means that this is not a capturing group. */      appearance of any of them means that this is not a capturing group. */
3932    
# Line 4176  for (;; ptr++) Line 4176  for (;; ptr++)
4176          if (*ptr == ')')          /* Optimize (?!) */          if (*ptr == ')')          /* Optimize (?!) */
4177            {            {
4178            *code++ = OP_FAIL;            *code++ = OP_FAIL;
4179            previous = NULL;            previous = NULL;
4180            continue;            continue;
4181            }            }
4182          bravalue = OP_ASSERT_NOT;          bravalue = OP_ASSERT_NOT;
4183          break;          break;
4184    

Legend:
Removed from v.210  
changed lines
  Added in v.211

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12