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

Diff of /code/trunk/pcre_study.c

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

revision 93 by nigel, Sat Feb 24 21:41:42 2007 UTC revision 335 by ph10, Sat Apr 12 14:36:14 2008 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2006 University of Cambridge             Copyright (c) 1997-2008 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 42  POSSIBILITY OF SUCH DAMAGE. Line 42  POSSIBILITY OF SUCH DAMAGE.
42  supporting functions. */  supporting functions. */
43    
44    
45    #ifdef HAVE_CONFIG_H
46    #include "config.h"
47    #endif
48    
49  #include "pcre_internal.h"  #include "pcre_internal.h"
50    
51    
# Line 213  do Line 217  do
217        tcode += 1 + LINK_SIZE;        tcode += 1 + LINK_SIZE;
218        break;        break;
219    
220          /* SKIPZERO skips the bracket. */
221    
222          case OP_SKIPZERO:
223          do tcode += GET(tcode,1); while (*tcode == OP_ALT);
224          tcode += 1 + LINK_SIZE;
225          break;
226    
227        /* Single-char * or ? sets the bit and tries the next item */        /* Single-char * or ? sets the bit and tries the next item */
228    
229        case OP_STAR:        case OP_STAR:
# Line 394  do Line 405  do
405        character with a value > 255. */        character with a value > 255. */
406    
407        case OP_NCLASS:        case OP_NCLASS:
408    #ifdef SUPPORT_UTF8
409        if (utf8)        if (utf8)
410          {          {
411          start_bits[24] |= 0xf0;              /* Bits for 0xc4 - 0xc8 */          start_bits[24] |= 0xf0;              /* Bits for 0xc4 - 0xc8 */
412          memset(start_bits+25, 0xff, 7);      /* Bits for 0xc9 - 0xff */          memset(start_bits+25, 0xff, 7);      /* Bits for 0xc9 - 0xff */
413          }          }
414    #endif
415        /* Fall through */        /* Fall through */
416    
417        case OP_CLASS:        case OP_CLASS:
# Line 411  do Line 424  do
424          value is > 127. In fact, there are only two possible starting bytes for          value is > 127. In fact, there are only two possible starting bytes for
425          characters in the range 128 - 255. */          characters in the range 128 - 255. */
426    
427    #ifdef SUPPORT_UTF8
428          if (utf8)          if (utf8)
429            {            {
430            for (c = 0; c < 16; c++) start_bits[c] |= tcode[c];            for (c = 0; c < 16; c++) start_bits[c] |= tcode[c];
# Line 428  do Line 442  do
442          /* In non-UTF-8 mode, the two bit maps are completely compatible. */          /* In non-UTF-8 mode, the two bit maps are completely compatible. */
443    
444          else          else
445    #endif
446            {            {
447            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];            for (c = 0; c < 32; c++) start_bits[c] |= tcode[c];
448            }            }
# Line 487  Returns:    pointer to a pcre_extra bloc Line 502  Returns:    pointer to a pcre_extra bloc
502              NULL on error or if no optimization possible              NULL on error or if no optimization possible
503  */  */
504    
505  PCRE_DATA_SCOPE pcre_extra *  PCRE_EXP_DEFN pcre_extra *
506  pcre_study(const pcre *external_re, int options, const char **errorptr)  pcre_study(const pcre *external_re, int options, const char **errorptr)
507  {  {
508  uschar start_bits[32];  uschar start_bits[32];
# Line 519  code = (uschar *)re + re->name_table_off Line 534  code = (uschar *)re + re->name_table_off
534  a multiline pattern that matches only at "line starts", no further processing  a multiline pattern that matches only at "line starts", no further processing
535  at present. */  at present. */
536    
537  if ((re->options & (PCRE_ANCHORED|PCRE_FIRSTSET|PCRE_STARTLINE)) != 0)  if ((re->options & PCRE_ANCHORED) != 0 ||
538        (re->flags & (PCRE_FIRSTSET|PCRE_STARTLINE)) != 0)
539    return NULL;    return NULL;
540    
541  /* Set the character tables in the block that is passed around */  /* Set the character tables in the block that is passed around */

Legend:
Removed from v.93  
changed lines
  Added in v.335

  ViewVC Help
Powered by ViewVC 1.1.5