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

Diff of /code/trunk/pcre_exec.c

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

revision 779 by ph10, Fri Dec 2 10:39:32 2011 UTC revision 788 by ph10, Tue Dec 6 15:38:01 2011 UTC
# Line 752  for (;;) Line 752  for (;;)
752      RRETURN(MATCH_SKIP);      RRETURN(MATCH_SKIP);
753    
754      /* Note that, for Perl compatibility, SKIP with an argument does NOT set      /* Note that, for Perl compatibility, SKIP with an argument does NOT set
755      nomatch_mark. There is a flag that disables this opcode when re-matching a      nomatch_mark. There is a flag that disables this opcode when re-matching a
756      pattern that ended with a SKIP for which there was not a matching MARK. */      pattern that ended with a SKIP for which there was not a matching MARK. */
757    
758      case OP_SKIP_ARG:      case OP_SKIP_ARG:
759      if (md->ignore_skip_arg)      if (md->ignore_skip_arg)
760        {        {
761        ecode += _pcre_OP_lengths[*ecode] + ecode[1];        ecode += _pcre_OP_lengths[*ecode] + ecode[1];
762        break;        break;
763        }        }
764      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,
765        eptrb, RM57);        eptrb, RM57);
766      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)
# Line 768  for (;;) Line 768  for (;;)
768    
769      /* Pass back the current skip name by overloading md->start_match_ptr and      /* Pass back the current skip name by overloading md->start_match_ptr and
770      returning the special MATCH_SKIP_ARG return code. This will either be      returning the special MATCH_SKIP_ARG return code. This will either be
771      caught by a matching MARK, or get to the top, where it causes a rematch      caught by a matching MARK, or get to the top, where it causes a rematch
772      with the md->ignore_skip_arg flag set. */      with the md->ignore_skip_arg flag set. */
773    
774      md->start_match_ptr = ecode + 2;      md->start_match_ptr = ecode + 2;
# Line 3037  for (;;) Line 3037  for (;;)
3037        }        }
3038      break;      break;
3039    
3040      /* Match a single character, caselessly. If we are at the end of the      /* Match a single character, caselessly. If we are at the end of the
3041      subject, give up immediately. */      subject, give up immediately. */
3042    
3043      case OP_CHARI:      case OP_CHARI:
3044      if (eptr >= md->end_subject)      if (eptr >= md->end_subject)
3045        {        {
3046        SCHECK_PARTIAL();        SCHECK_PARTIAL();
3047        RRETURN(MATCH_NOMATCH);        RRETURN(MATCH_NOMATCH);
3048        }        }
3049    
3050  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3051      if (utf8)      if (utf8)
3052        {        {
3053        length = 1;        length = 1;
3054        ecode++;        ecode++;
3055        GETCHARLEN(fc, ecode, length);        GETCHARLEN(fc, ecode, length);
3056    
3057        /* If the pattern character's value is < 128, we have only one byte, and        /* If the pattern character's value is < 128, we have only one byte, and
3058        we know that its other case must also be one byte long, so we can use the        we know that its other case must also be one byte long, so we can use the
3059        fast lookup table. We know that there is at least one byte left in the        fast lookup table. We know that there is at least one byte left in the
3060        subject. */        subject. */
3061    
3062        if (fc < 128)        if (fc < 128)
# Line 6456  for(;;) Line 6456  for(;;)
6456    switch(rc)    switch(rc)
6457      {      {
6458      /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched      /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched
6459      the SKIP's arg was not found. In this circumstance, Perl ignores the SKIP      the SKIP's arg was not found. In this circumstance, Perl ignores the SKIP
6460      entirely. The only way we can do that is to re-do the match at the same      entirely. The only way we can do that is to re-do the match at the same
6461      point, with a flag to force SKIP with an argument to be ignored. Just      point, with a flag to force SKIP with an argument to be ignored. Just
6462      treating this case as NOMATCH does not work because it does not check other      treating this case as NOMATCH does not work because it does not check other
6463      alternatives in patterns such as A(*SKIP:A)B|AC when the subject is AC. */      alternatives in patterns such as A(*SKIP:A)B|AC when the subject is AC. */
6464    
6465      case MATCH_SKIP_ARG:      case MATCH_SKIP_ARG:
6466      new_start_match = start_match;      new_start_match = start_match;
6467      md->ignore_skip_arg = TRUE;      md->ignore_skip_arg = TRUE;
6468      break;      break;
6469    
6470      /* SKIP passes back the next starting point explicitly, but if it is the      /* SKIP passes back the next starting point explicitly, but if it is the
6471      same as the match we have just done, treat it as NOMATCH. */      same as the match we have just done, treat it as NOMATCH. */
# Line 6614  if (rc == MATCH_MATCH || rc == MATCH_ACC Line 6614  if (rc == MATCH_MATCH || rc == MATCH_ACC
6614      }      }
6615    
6616    /* Return MARK data if requested */    /* Return MARK data if requested */
6617    
6618    if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0)    if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0)
6619      *(extra_data->mark) = (unsigned char *)(md->mark);      *(extra_data->mark) = (unsigned char *)(md->mark);
6620    DPRINTF((">>>> returning %d\n", rc));    DPRINTF((">>>> returning %d\n", rc));

Legend:
Removed from v.779  
changed lines
  Added in v.788

  ViewVC Help
Powered by ViewVC 1.1.5