/[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 1411 by ph10, Fri Dec 6 17:11:44 2013 UTC revision 1412 by ph10, Sun Dec 15 17:01:46 2013 UTC
# Line 260  static const verbitem verbs[] = { Line 260  static const verbitem verbs[] = {
260  static const int verbcount = sizeof(verbs)/sizeof(verbitem);  static const int verbcount = sizeof(verbs)/sizeof(verbitem);
261    
262    
263  /* Substitutes for [[:<:]] and [[:>:]], which mean start and end of word in  /* Substitutes for [[:<:]] and [[:>:]], which mean start and end of word in
264  another regex library. */  another regex library. */
265    
266  static const pcre_uchar sub_start_of_word[] = {  static const pcre_uchar sub_start_of_word[] = {
267    CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,    CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
268    CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w, CHAR_RIGHT_PARENTHESIS, '\0' };    CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w, CHAR_RIGHT_PARENTHESIS, '\0' };
269    
270  static const pcre_uchar sub_end_of_word[] = {  static const pcre_uchar sub_end_of_word[] = {
271    CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,    CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
272    CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w,    CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w,
273    CHAR_RIGHT_PARENTHESIS, '\0' };    CHAR_RIGHT_PARENTHESIS, '\0' };
274    
275    
276  /* Tables of names of POSIX character classes and their lengths. The names are  /* Tables of names of POSIX character classes and their lengths. The names are
# Line 4703  for (;; ptr++) Line 4703  for (;; ptr++)
4703        goto FAILED;        goto FAILED;
4704        }        }
4705      goto NORMAL_CHAR;      goto NORMAL_CHAR;
4706    
4707      /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is      /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
4708      used for "start of word" and "end of word". As these are otherwise illegal      used for "start of word" and "end of word". As these are otherwise illegal
4709      sequences, we don't break anything by recognizing them. They are replaced      sequences, we don't break anything by recognizing them. They are replaced
4710      by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are      by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
# Line 4715  for (;; ptr++) Line 4715  for (;; ptr++)
4715        {        {
4716        nestptr = ptr + 7;        nestptr = ptr + 7;
4717        ptr = sub_start_of_word - 1;        ptr = sub_start_of_word - 1;
4718        continue;        continue;
4719        }        }
4720    
4721      if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)      if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
4722        {        {
4723        nestptr = ptr + 7;        nestptr = ptr + 7;
4724        ptr = sub_end_of_word - 1;        ptr = sub_end_of_word - 1;
4725        continue;        continue;
4726        }        }
4727    
4728      /* Handle a real character class. */      /* Handle a real character class. */
4729    
4730      previous = code;      previous = code;
4731    
4732      /* PCRE supports POSIX class stuff inside a class. Perl gives an error if      /* PCRE supports POSIX class stuff inside a class. Perl gives an error if

Legend:
Removed from v.1411  
changed lines
  Added in v.1412

  ViewVC Help
Powered by ViewVC 1.1.5