/[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 1430 by ph10, Wed Jan 1 17:11:54 2014 UTC revision 1431 by ph10, Thu Jan 2 17:41:28 2014 UTC
# Line 7  and semantics are as close as possible t Line 7  and semantics are as close as possible t
7  below for why this module is different).  below for why this module is different).
8    
9                         Written by Philip Hazel                         Written by Philip Hazel
10             Copyright (c) 1997-2013 University of Cambridge             Copyright (c) 1997-2014 University of Cambridge
11    
12  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
13  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 1473  for (;;) Line 1473  for (;;)
1473            goto ANYNL01;            goto ANYNL01;
1474    
1475            case CHAR_CR:            case CHAR_CR:
1476            if (ptr + 1 < end_subject && ptr[1] == CHAR_LF) ncount = 1;            if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1;
1477            /* Fall through */            /* Fall through */
1478    
1479            ANYNL01:            ANYNL01:
# Line 1742  for (;;) Line 1742  for (;;)
1742            goto ANYNL02;            goto ANYNL02;
1743    
1744            case CHAR_CR:            case CHAR_CR:
1745            if (ptr + 1 < end_subject && ptr[1] == CHAR_LF) ncount = 1;            if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1;
1746            /* Fall through */            /* Fall through */
1747    
1748            ANYNL02:            ANYNL02:
# Line 2012  for (;;) Line 2012  for (;;)
2012            goto ANYNL03;            goto ANYNL03;
2013    
2014            case CHAR_CR:            case CHAR_CR:
2015            if (ptr + 1 < end_subject && ptr[1] == CHAR_LF) ncount = 1;            if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1;
2016            /* Fall through */            /* Fall through */
2017    
2018            ANYNL03:            ANYNL03:
# Line 2210  for (;;) Line 2210  for (;;)
2210            if ((md->moptions & PCRE_PARTIAL_HARD) != 0)            if ((md->moptions & PCRE_PARTIAL_HARD) != 0)
2211              reset_could_continue = TRUE;              reset_could_continue = TRUE;
2212            }            }
2213          else if (ptr[1] == CHAR_LF)          else if (UCHAR21TEST(ptr + 1) == CHAR_LF)
2214            {            {
2215            ADD_NEW_DATA(-(state_offset + 1), 0, 1);            ADD_NEW_DATA(-(state_offset + 1), 0, 1);
2216            }            }
# Line 3474  for (;;) Line 3474  for (;;)
3474            {            {
3475            pcre_uchar csc;            pcre_uchar csc;
3476            while (current_subject < end_subject &&            while (current_subject < end_subject &&
3477                   (csc = *current_subject) != first_char && csc != first_char2)                   (csc = UCHAR21TEST(current_subject)) != first_char && csc != first_char2)
3478              current_subject++;              current_subject++;
3479            }            }
3480          else          else
3481            while (current_subject < end_subject &&            while (current_subject < end_subject &&
3482                   *current_subject != first_char)                   UCHAR21TEST(current_subject) != first_char)
3483              current_subject++;              current_subject++;
3484          }          }
3485    
# Line 3509  for (;;) Line 3509  for (;;)
3509            ANYCRLF, and we are now at a LF, advance the match position by one            ANYCRLF, and we are now at a LF, advance the match position by one
3510            more character. */            more character. */
3511    
3512            if (current_subject[-1] == CHAR_CR &&            if (UCHAR21TEST(current_subject - 1) == CHAR_CR &&
3513                 (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&                 (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
3514                 current_subject < end_subject && *current_subject == CHAR_NL)                 current_subject < end_subject &&
3515                   UCHAR21TEST(current_subject) == CHAR_NL)
3516              current_subject++;              current_subject++;
3517            }            }
3518          }          }
# Line 3522  for (;;) Line 3523  for (;;)
3523          {          {
3524          while (current_subject < end_subject)          while (current_subject < end_subject)
3525            {            {
3526            register pcre_uint32 c = *current_subject;            register pcre_uint32 c = UCHAR21TEST(current_subject);
3527  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
3528            if (c > 255) c = 255;            if (c > 255) c = 255;
3529  #endif  #endif
# Line 3579  for (;;) Line 3580  for (;;)
3580              {              {
3581              while (p < end_subject)              while (p < end_subject)
3582                {                {
3583                register pcre_uint32 pp = *p++;                register pcre_uint32 pp = UCHAR21INCTEST(p);
3584                if (pp == req_char || pp == req_char2) { p--; break; }                if (pp == req_char || pp == req_char2) { p--; break; }
3585                }                }
3586              }              }
# Line 3587  for (;;) Line 3588  for (;;)
3588              {              {
3589              while (p < end_subject)              while (p < end_subject)
3590                {                {
3591                if (*p++ == req_char) { p--; break; }                if (UCHAR21INCTEST(p) == req_char) { p--; break; }
3592                }                }
3593              }              }
3594    
# Line 3655  for (;;) Line 3656  for (;;)
3656    not contain any explicit matches for \r or \n, and the newline option is CRLF    not contain any explicit matches for \r or \n, and the newline option is CRLF
3657    or ANY or ANYCRLF, advance the match position by one more character. */    or ANY or ANYCRLF, advance the match position by one more character. */
3658    
3659    if (current_subject[-1] == CHAR_CR &&    if (UCHAR21TEST(current_subject - 1) == CHAR_CR &&
3660        current_subject < end_subject &&        current_subject < end_subject &&
3661        *current_subject == CHAR_NL &&        UCHAR21TEST(current_subject) == CHAR_NL &&
3662        (re->flags & PCRE_HASCRORLF) == 0 &&        (re->flags & PCRE_HASCRORLF) == 0 &&
3663          (md->nltype == NLTYPE_ANY ||          (md->nltype == NLTYPE_ANY ||
3664           md->nltype == NLTYPE_ANYCRLF ||           md->nltype == NLTYPE_ANYCRLF ||

Legend:
Removed from v.1430  
changed lines
  Added in v.1431

  ViewVC Help
Powered by ViewVC 1.1.5