/[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 1404 by ph10, Tue Nov 19 15:36:57 2013 UTC revision 1408 by ph10, Tue Dec 3 16:27:00 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
264    another regex library. */
265    
266    static const pcre_uchar sub_start_of_word[] = {
267      CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
268      CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w, CHAR_RIGHT_PARENTHESIS, '\0' };
269    
270    static const pcre_uchar sub_end_of_word[] = {
271      CHAR_BACKSLASH, CHAR_b, CHAR_LEFT_PARENTHESIS, CHAR_QUESTION_MARK,
272      CHAR_LESS_THAN_SIGN, CHAR_EQUALS_SIGN, CHAR_BACKSLASH, CHAR_w,
273      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
277  now all in a single string, to reduce the number of relocations when a shared  now all in a single string, to reduce the number of relocations when a shared
278  library is dynamically loaded. The list of lengths is terminated by a zero  library is dynamically loaded. The list of lengths is terminated by a zero
# Line 4685  for (;; ptr++) Line 4698  for (;; ptr++)
4698        goto FAILED;        goto FAILED;
4699        }        }
4700      goto NORMAL_CHAR;      goto NORMAL_CHAR;
4701    
4702        /* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
4703        used for "start of word" and "end of word". As these are otherwise illegal
4704        sequences, we don't break anything by recognizing them. They are replaced
4705        by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
4706        erroneous and are handled by the normal code below. */
4707    
4708      case CHAR_LEFT_SQUARE_BRACKET:      case CHAR_LEFT_SQUARE_BRACKET:
4709        if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
4710          {
4711          nestptr = ptr + 7;
4712          ptr = sub_start_of_word - 1;
4713          continue;
4714          }
4715    
4716        if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
4717          {
4718          nestptr = ptr + 7;
4719          ptr = sub_end_of_word - 1;
4720          continue;
4721          }
4722    
4723        /* Handle a real character class. */
4724    
4725      previous = code;      previous = code;
4726    
4727      /* 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.1404  
changed lines
  Added in v.1408

  ViewVC Help
Powered by ViewVC 1.1.5