/[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 975 by ph10, Sat Jun 2 11:03:06 2012 UTC revision 979 by ph10, Sun Jun 17 19:08:41 2012 UTC
# Line 38  POSSIBILITY OF SUCH DAMAGE. Line 38  POSSIBILITY OF SUCH DAMAGE.
38  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
39  */  */
40    
   
41  /* This module contains the external function pcre_dfa_exec(), which is an  /* This module contains the external function pcre_dfa_exec(), which is an
42  alternative matching function that uses a sort of DFA algorithm (not a true  alternative matching function that uses a sort of DFA algorithm (not a true
43  FSM). This is NOT Perl-compatible, but it has advantages in certain  FSM). This is NOT Perl-compatible, but it has advantages in certain
# Line 382  for the current character, one for the f Line 381  for the current character, one for the f
381      next_new_state->count  = (y); \      next_new_state->count  = (y); \
382      next_new_state->data   = (z); \      next_new_state->data   = (z); \
383      next_new_state++; \      next_new_state++; \
384      DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \      DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d) line %d\n", rlevel*2-2, SP, \
385          (x), (y), (z), __LINE__)); \
386      } \      } \
387    else return PCRE_ERROR_DFA_WSSIZE    else return PCRE_ERROR_DFA_WSSIZE
388    
# Line 611  for (;;) Line 611  for (;;)
611    
612    if (ptr < end_subject)    if (ptr < end_subject)
613      {      {
614      clen = 1;        /* Number of bytes in the character */      clen = 1;        /* Number of data items in the character */
615  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
616      if (utf) { GETCHARLEN(c, ptr, clen); } else      if (utf) { GETCHARLEN(c, ptr, clen); } else
617  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
# Line 789  for (;;) Line 789  for (;;)
789              offsets[0] = (int)(current_subject - start_subject);              offsets[0] = (int)(current_subject - start_subject);
790              offsets[1] = (int)(ptr - start_subject);              offsets[1] = (int)(ptr - start_subject);
791              DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,              DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP,
792                offsets[1] - offsets[0], current_subject));                offsets[1] - offsets[0], (char *)current_subject));
793              }              }
794            if ((md->moptions & PCRE_DFA_SHORTEST) != 0)            if ((md->moptions & PCRE_DFA_SHORTEST) != 0)
795              {              {
# Line 2797  for (;;) Line 2797  for (;;)
2797              {              {
2798              int charcount = local_offsets[rc+1] - local_offsets[rc];              int charcount = local_offsets[rc+1] - local_offsets[rc];
2799  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
2800              const pcre_uchar *p = start_subject + local_offsets[rc];              if (utf)
2801              const pcre_uchar *pp = start_subject + local_offsets[rc+1];                {
2802              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;                const pcre_uchar *p = start_subject + local_offsets[rc];
2803                  const pcre_uchar *pp = start_subject + local_offsets[rc+1];
2804                  while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
2805                  }
2806  #endif  #endif
2807              if (charcount > 0)              if (charcount > 0)
2808                {                {
# Line 2898  for (;;) Line 2901  for (;;)
2901              const pcre_uchar *pp = local_ptr;              const pcre_uchar *pp = local_ptr;
2902              charcount = (int)(pp - p);              charcount = (int)(pp - p);
2903  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
2904              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;              if (utf) while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
2905  #endif  #endif
2906              ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));              ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));
2907              }              }
# Line 2980  for (;;) Line 2983  for (;;)
2983            else            else
2984              {              {
2985  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
2986              const pcre_uchar *p = start_subject + local_offsets[0];              if (utf)
2987              const pcre_uchar *pp = start_subject + local_offsets[1];                {
2988              while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;                const pcre_uchar *p = start_subject + local_offsets[0];
2989                  const pcre_uchar *pp = start_subject + local_offsets[1];
2990                  while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
2991                  }
2992  #endif  #endif
2993              ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));              ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));
2994              if (repeat_state_offset >= 0)              if (repeat_state_offset >= 0)

Legend:
Removed from v.975  
changed lines
  Added in v.979

  ViewVC Help
Powered by ViewVC 1.1.5