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

Diff of /code/trunk/pcre_dfa_exec.c

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

revision 398 by ph10, Fri Mar 20 20:41:29 2009 UTC revision 427 by ph10, Fri Aug 28 09:55:54 2009 UTC
# Line 2157  for (;;) Line 2157  for (;;)
2157    
2158  /* ========================================================================== */  /* ========================================================================== */
2159        /* These are the opcodes for fancy brackets of various kinds. We have        /* These are the opcodes for fancy brackets of various kinds. We have
2160        to use recursion in order to handle them. The "always failing" assersion        to use recursion in order to handle them. The "always failing" assertion
2161        (?!) is optimised when compiling to OP_FAIL, so we have to support that,        (?!) is optimised to OP_FAIL when compiling, so we have to support that,
2162        though the other "backtracking verbs" are not supported. */        though the other "backtracking verbs" are not supported. */
2163    
2164        case OP_FAIL:        case OP_FAIL:
# Line 2200  for (;;) Line 2200  for (;;)
2200          {          {
2201          int local_offsets[1000];          int local_offsets[1000];
2202          int local_workspace[1000];          int local_workspace[1000];
2203          int codelink = GET(code, 1);          int codelink = GET(code, 1);
2204          int condcode;          int condcode;
2205    
2206          /* Because of the way auto-callout works during compile, a callout item          /* Because of the way auto-callout works during compile, a callout item
2207          is inserted between OP_COND and an assertion condition. This does not          is inserted between OP_COND and an assertion condition. This does not
2208          happen for the other conditions. */          happen for the other conditions. */
2209    
2210          if (code[LINK_SIZE+1] == OP_CALLOUT)          if (code[LINK_SIZE+1] == OP_CALLOUT)
2211            {            {
2212            rrc = 0;            rrc = 0;
2213            if (pcre_callout != NULL)            if (pcre_callout != NULL)
2214              {              {
2215              pcre_callout_block cb;              pcre_callout_block cb;
# Line 2229  for (;;) Line 2229  for (;;)
2229              }              }
2230            if (rrc > 0) break;                      /* Fail this thread */            if (rrc > 0) break;                      /* Fail this thread */
2231            code += _pcre_OP_lengths[OP_CALLOUT];    /* Skip callout data */            code += _pcre_OP_lengths[OP_CALLOUT];    /* Skip callout data */
2232            }            }
2233    
2234          condcode = code[LINK_SIZE+1];          condcode = code[LINK_SIZE+1];
2235    
2236          /* Back reference conditions are not supported */          /* Back reference conditions are not supported */
2237    
2238          if (condcode == OP_CREF) return PCRE_ERROR_DFA_UCOND;          if (condcode == OP_CREF) return PCRE_ERROR_DFA_UCOND;
# Line 2250  for (;;) Line 2250  for (;;)
2250            {            {
2251            int value = GET2(code, LINK_SIZE+2);            int value = GET2(code, LINK_SIZE+2);
2252            if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;            if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;
2253            if (recursing > 0)            if (recursing > 0)
2254              { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); }              { ADD_ACTIVE(state_offset + LINK_SIZE + 4, 0); }
2255            else { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }            else { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
2256            }            }
# Line 2434  for (;;) Line 2434  for (;;)
2434        /* Handle callouts */        /* Handle callouts */
2435    
2436        case OP_CALLOUT:        case OP_CALLOUT:
2437        rrc = 0;        rrc = 0;
2438        if (pcre_callout != NULL)        if (pcre_callout != NULL)
2439          {          {
2440          pcre_callout_block cb;          pcre_callout_block cb;
# Line 2451  for (;;) Line 2451  for (;;)
2451          cb.capture_last     = -1;          cb.capture_last     = -1;
2452          cb.callout_data     = md->callout_data;          cb.callout_data     = md->callout_data;
2453          if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc;   /* Abandon */          if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc;   /* Abandon */
2454          }          }
2455        if (rrc == 0)        if (rrc == 0)
2456          { ADD_ACTIVE(state_offset + _pcre_OP_lengths[OP_CALLOUT], 0); }          { ADD_ACTIVE(state_offset + _pcre_OP_lengths[OP_CALLOUT], 0); }
2457        break;        break;
2458    
2459    
# Line 2473  for (;;) Line 2473  for (;;)
2473    
2474    if (new_count <= 0)    if (new_count <= 0)
2475      {      {
2476      if (match_count < 0 &&                     /* No matches found */      if (rlevel == 1 &&                               /* Top level, and */
2477          rlevel == 1 &&                         /* Top level match function */          (                                            /* either... */
2478          (md->moptions & PCRE_PARTIAL) != 0 &&  /* Want partial matching */          (md->moptions & PCRE_PARTIAL_HARD) != 0      /* Hard partial */
2479          ptr >= end_subject &&                  /* Reached end of subject */          ||                                           /* or... */
2480          ptr > current_subject)                 /* Matched non-empty string */          ((md->moptions & PCRE_PARTIAL_SOFT) != 0 &&  /* Soft partial and */
2481             match_count < 0)                            /* no matches */
2482            ) &&                                         /* And... */
2483            ptr >= end_subject &&                     /* Reached end of subject */
2484            ptr > current_subject)                    /* Matched non-empty string */
2485        {        {
2486        if (offsetcount >= 2)        if (offsetcount >= 2)
2487          {          {

Legend:
Removed from v.398  
changed lines
  Added in v.427

  ViewVC Help
Powered by ViewVC 1.1.5