/[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 924 by zherczeg, Wed Feb 22 10:23:56 2012 UTC revision 927 by ph10, Wed Feb 22 15:15:08 2012 UTC
# Line 4516  for (;; ptr++) Line 4516  for (;; ptr++)
4516        LONE_SINGLE_CHARACTER:        LONE_SINGLE_CHARACTER:
4517    
4518        /* Only the value of 1 matters for class_single_char. */        /* Only the value of 1 matters for class_single_char. */
4519    
4520        if (class_single_char < 2) class_single_char++;        if (class_single_char < 2) class_single_char++;
4521    
4522        /* If class_charcount is 1, we saw precisely one character. As long as        /* If class_charcount is 1, we saw precisely one character. As long as
4523        there was no use of \p or \P, in other words, no use of any XCLASS features,        there was no use of \p or \P, in other words, no use of any XCLASS
4524        we can optimize.        features, we can optimize.
4525    
4526        The optimization throws away the bit map. We turn the item into a        The optimization throws away the bit map. We turn the item into a
4527        1-character OP_CHAR[I] if it's positive, or OP_NOT[I] if it's negative.        1-character OP_CHAR[I] if it's positive, or OP_NOT[I] if it's negative.
# Line 4533  for (;; ptr++) Line 4534  for (;; ptr++)
4534          ptr++;          ptr++;
4535          zeroreqchar = reqchar;          zeroreqchar = reqchar;
4536    
         /* The OP_NOT[I] opcodes work on single characters only. */  
   
4537          if (negate_class)          if (negate_class)
4538            {            {
4539            if (firstchar == REQ_UNSET) firstchar = REQ_NONE;            if (firstchar == REQ_UNSET) firstchar = REQ_NONE;
# Line 4804  for (;; ptr++) Line 4803  for (;; ptr++)
4803      /* Now handle repetition for the different types of item. */      /* Now handle repetition for the different types of item. */
4804    
4805      /* If previous was a character or negated character match, abolish the item      /* If previous was a character or negated character match, abolish the item
4806      and generate a repeat item instead. If a char item has a minumum of more      and generate a repeat item instead. If a char item has a minimum of more
4807      than one, ensure  that it is set in reqchar - it might not be if a sequence      than one, ensure that it is set in reqchar - it might not be if a sequence
4808      such as x{3} is  the first thing in a branch because the x will have gone      such as x{3} is the first thing in a branch because the x will have gone
4809      into firstchar instead.  */      into firstchar instead.  */
4810    
4811      if (*previous == OP_CHAR || *previous == OP_CHARI      if (*previous == OP_CHAR || *previous == OP_CHARI
4812          || *previous == OP_NOT || *previous == OP_NOTI)          || *previous == OP_NOT || *previous == OP_NOTI)
4813        {        {
4814        switch (*previous) {        switch (*previous)
4815        default: /* Make compiler happy. */          {
4816        case OP_CHAR:  op_type = OP_STAR - OP_STAR; break;          default: /* Make compiler happy. */
4817        case OP_CHARI: op_type = OP_STARI - OP_STAR; break;          case OP_CHAR:  op_type = OP_STAR - OP_STAR; break;
4818        case OP_NOT:   op_type = OP_NOTSTAR - OP_STAR; break;          case OP_CHARI: op_type = OP_STARI - OP_STAR; break;
4819        case OP_NOTI:  op_type = OP_NOTSTARI - OP_STAR; break;          case OP_NOT:   op_type = OP_NOTSTAR - OP_STAR; break;
4820        }          case OP_NOTI:  op_type = OP_NOTSTARI - OP_STAR; break;
4821            }
4822    
4823        /* Deal with UTF characters that take up more than one character. It's        /* Deal with UTF characters that take up more than one character. It's
4824        easier to write this out separately than try to macrify it. Use c to        easier to write this out separately than try to macrify it. Use c to

Legend:
Removed from v.924  
changed lines
  Added in v.927

  ViewVC Help
Powered by ViewVC 1.1.5