/[pcre]/code/branches/pcre16/pcre_study.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_study.c

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

revision 601 by ph10, Sun Oct 10 16:24:11 2010 UTC revision 602 by ph10, Wed May 25 08:29:03 2011 UTC
# Line 160  for (;;) Line 160  for (;;)
160      case OP_RREF:      case OP_RREF:
161      case OP_NRREF:      case OP_NRREF:
162      case OP_DEF:      case OP_DEF:
     case OP_OPT:  
163      case OP_CALLOUT:      case OP_CALLOUT:
164      case OP_SOD:      case OP_SOD:
165      case OP_SOM:      case OP_SOM:
166      case OP_EOD:      case OP_EOD:
167      case OP_EODN:      case OP_EODN:
168      case OP_CIRC:      case OP_CIRC:
169        case OP_CIRCM:
170      case OP_DOLL:      case OP_DOLL:
171        case OP_DOLLM:
172      case OP_NOT_WORD_BOUNDARY:      case OP_NOT_WORD_BOUNDARY:
173      case OP_WORD_BOUNDARY:      case OP_WORD_BOUNDARY:
174      cc += _pcre_OP_lengths[*cc];      cc += _pcre_OP_lengths[*cc];
# Line 186  for (;;) Line 187  for (;;)
187      /* Handle literal characters and + repetitions */      /* Handle literal characters and + repetitions */
188    
189      case OP_CHAR:      case OP_CHAR:
190      case OP_CHARNC:      case OP_CHARI:
191      case OP_NOT:      case OP_NOT:
192        case OP_NOTI:
193      case OP_PLUS:      case OP_PLUS:
194      case OP_MINPLUS:      case OP_MINPLUS:
195      case OP_POSPLUS:      case OP_POSPLUS:
# Line 337  for (;;) Line 339  for (;;)
339      that case we must set the minimum length to zero. */      that case we must set the minimum length to zero. */
340    
341      case OP_REF:      case OP_REF:
342        case OP_REFI:
343      if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)      if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)
344        {        {
345        ce = cs = (uschar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1));        ce = cs = (uschar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1));
# Line 391  for (;;) Line 394  for (;;)
394    
395      /* Anything else does not or need not match a character. We can get the      /* Anything else does not or need not match a character. We can get the
396      item's length from the table, but for those that can match zero occurrences      item's length from the table, but for those that can match zero occurrences
397      of a character, we must take special action for UTF-8 characters. */      of a character, we must take special action for UTF-8 characters. As it
398        happens, the "NOT" versions of these opcodes are used at present only for
399        ASCII characters, so they could be omitted from this list. However, in
400        future that may change, so we leave them in this special case. */
401    
402      case OP_UPTO:      case OP_UPTO:
403        case OP_UPTOI:
404      case OP_NOTUPTO:      case OP_NOTUPTO:
405        case OP_NOTUPTOI:
406      case OP_MINUPTO:      case OP_MINUPTO:
407        case OP_MINUPTOI:
408      case OP_NOTMINUPTO:      case OP_NOTMINUPTO:
409        case OP_NOTMINUPTOI:
410      case OP_POSUPTO:      case OP_POSUPTO:
411        case OP_POSUPTOI:
412        case OP_NOTPOSUPTO:
413        case OP_NOTPOSUPTOI:
414    
415      case OP_STAR:      case OP_STAR:
416        case OP_STARI:
417        case OP_NOTSTAR:
418        case OP_NOTSTARI:
419      case OP_MINSTAR:      case OP_MINSTAR:
420        case OP_MINSTARI:
421      case OP_NOTMINSTAR:      case OP_NOTMINSTAR:
422        case OP_NOTMINSTARI:
423      case OP_POSSTAR:      case OP_POSSTAR:
424        case OP_POSSTARI:
425      case OP_NOTPOSSTAR:      case OP_NOTPOSSTAR:
426        case OP_NOTPOSSTARI:
427    
428      case OP_QUERY:      case OP_QUERY:
429        case OP_QUERYI:
430        case OP_NOTQUERY:
431        case OP_NOTQUERYI:
432      case OP_MINQUERY:      case OP_MINQUERY:
433        case OP_MINQUERYI:
434      case OP_NOTMINQUERY:      case OP_NOTMINQUERY:
435        case OP_NOTMINQUERYI:
436      case OP_POSQUERY:      case OP_POSQUERY:
437        case OP_POSQUERYI:
438      case OP_NOTPOSQUERY:      case OP_NOTPOSQUERY:
439        case OP_NOTPOSQUERYI:
440    
441      cc += _pcre_OP_lengths[op];      cc += _pcre_OP_lengths[op];
442  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
443      if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];      if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
# Line 679  do Line 709  do
709        tcode += 1 + LINK_SIZE;        tcode += 1 + LINK_SIZE;
710        break;        break;
711    
       /* Skip over an option setting, changing the caseless flag */  
   
       case OP_OPT:  
       caseless = (tcode[1] & PCRE_CASELESS) != 0;  
       tcode += 2;  
       break;  
   
712        /* BRAZERO does the bracket, but carries on. */        /* BRAZERO does the bracket, but carries on. */
713    
714        case OP_BRAZERO:        case OP_BRAZERO:
# Line 720  do Line 743  do
743        tcode = set_table_bit(start_bits, tcode + 1, caseless, cd, utf8);        tcode = set_table_bit(start_bits, tcode + 1, caseless, cd, utf8);
744        break;        break;
745    
746          case OP_STARI:
747          case OP_MINSTARI:
748          case OP_POSSTARI:
749          case OP_QUERYI:
750          case OP_MINQUERYI:
751          case OP_POSQUERYI:
752          tcode = set_table_bit(start_bits, tcode + 1, TRUE, cd, utf8);
753          break;
754    
755        /* Single-char upto sets the bit and tries the next */        /* Single-char upto sets the bit and tries the next */
756    
757        case OP_UPTO:        case OP_UPTO:
# Line 728  do Line 760  do
760        tcode = set_table_bit(start_bits, tcode + 3, caseless, cd, utf8);        tcode = set_table_bit(start_bits, tcode + 3, caseless, cd, utf8);
761        break;        break;
762    
763          case OP_UPTOI:
764          case OP_MINUPTOI:
765          case OP_POSUPTOI:
766          tcode = set_table_bit(start_bits, tcode + 3, TRUE, cd, utf8);
767          break;
768    
769        /* At least one single char sets the bit and stops */        /* At least one single char sets the bit and stops */
770    
771        case OP_EXACT:       /* Fall through */        case OP_EXACT:
772        tcode += 2;        tcode += 2;
773          /* Fall through */
774        case OP_CHAR:        case OP_CHAR:
       case OP_CHARNC:  
775        case OP_PLUS:        case OP_PLUS:
776        case OP_MINPLUS:        case OP_MINPLUS:
777        case OP_POSPLUS:        case OP_POSPLUS:
# Line 742  do Line 779  do
779        try_next = FALSE;        try_next = FALSE;
780        break;        break;
781    
782          case OP_CHARI:
783          case OP_PLUSI:
784          case OP_MINPLUSI:
785          case OP_POSPLUSI:
786          (void)set_table_bit(start_bits, tcode + 1, TRUE, cd, utf8);
787          try_next = FALSE;
788          break;
789    
790        /* Special spacing and line-terminating items. These recognize specific        /* Special spacing and line-terminating items. These recognize specific
791        lists of characters. The difference between VSPACE and ANYNL is that the        lists of characters. The difference between VSPACE and ANYNL is that the
792        latter can match the two-character CRLF sequence, but that is not        latter can match the two-character CRLF sequence, but that is not

Legend:
Removed from v.601  
changed lines
  Added in v.602

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12