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

Diff of /code/trunk/pcretest.c

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

revision 567 by ph10, Sat Nov 6 17:10:00 2010 UTC revision 579 by ph10, Wed Nov 24 17:39:25 2010 UTC
# Line 1588  while (!done) Line 1588  while (!done)
1588        case 'U': options |= PCRE_UNGREEDY; break;        case 'U': options |= PCRE_UNGREEDY; break;
1589        case 'W': options |= PCRE_UCP; break;        case 'W': options |= PCRE_UCP; break;
1590        case 'X': options |= PCRE_EXTRA; break;        case 'X': options |= PCRE_EXTRA; break;
1591          case 'Y': options |= PCRE_NO_START_OPTIMISE; break;
1592        case 'Z': debug_lengths = 0; break;        case 'Z': debug_lengths = 0; break;
1593        case '8': options |= PCRE_UTF8; use_utf8 = 1; break;        case '8': options |= PCRE_UTF8; use_utf8 = 1; break;
1594        case '?': options |= PCRE_NO_UTF8_CHECK; break;        case '?': options |= PCRE_NO_UTF8_CHECK; break;
# Line 1924  while (!done) Line 1925  while (!done)
1925        if (do_flip) all_options = byteflip(all_options, sizeof(all_options));        if (do_flip) all_options = byteflip(all_options, sizeof(all_options));
1926    
1927        if (get_options == 0) fprintf(outfile, "No options\n");        if (get_options == 0) fprintf(outfile, "No options\n");
1928          else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",          else fprintf(outfile, "Options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
1929            ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "",            ((get_options & PCRE_ANCHORED) != 0)? " anchored" : "",
1930            ((get_options & PCRE_CASELESS) != 0)? " caseless" : "",            ((get_options & PCRE_CASELESS) != 0)? " caseless" : "",
1931            ((get_options & PCRE_EXTENDED) != 0)? " extended" : "",            ((get_options & PCRE_EXTENDED) != 0)? " extended" : "",
# Line 1940  while (!done) Line 1941  while (!done)
1941            ((get_options & PCRE_UTF8) != 0)? " utf8" : "",            ((get_options & PCRE_UTF8) != 0)? " utf8" : "",
1942            ((get_options & PCRE_UCP) != 0)? " ucp" : "",            ((get_options & PCRE_UCP) != 0)? " ucp" : "",
1943            ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : "",            ((get_options & PCRE_NO_UTF8_CHECK) != 0)? " no_utf8_check" : "",
1944              ((get_options & PCRE_NO_START_OPTIMIZE) != 0)? " no_start_optimize" : "",
1945            ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : "");            ((get_options & PCRE_DUPNAMES) != 0)? " dupnames" : "");
1946    
1947        if (jchanged) fprintf(outfile, "Duplicate name status changes\n");        if (jchanged) fprintf(outfile, "Duplicate name status changes\n");
# Line 2132  while (!done) Line 2134  while (!done)
2134      int getlist = 0;      int getlist = 0;
2135      int gmatched = 0;      int gmatched = 0;
2136      int start_offset = 0;      int start_offset = 0;
2137      int start_offset_sign = 1;      int start_offset_sign = 1;
2138      int g_notempty = 0;      int g_notempty = 0;
2139      int use_dfa = 0;      int use_dfa = 0;
2140    
# Line 2265  while (!done) Line 2267  while (!done)
2267          continue;          continue;
2268    
2269          case '>':          case '>':
2270          if (*p == '-')          if (*p == '-')
2271            {            {
2272            start_offset_sign = -1;            start_offset_sign = -1;
2273            p++;            p++;
2274            }            }
2275          while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0';          while(isdigit(*p)) start_offset = start_offset * 10 + *p++ - '0';
2276          start_offset *= start_offset_sign;          start_offset *= start_offset_sign;
2277          continue;          continue;
2278    
2279          case 'A':  /* Option setting */          case 'A':  /* Option setting */
# Line 2799  while (!done) Line 2801  while (!done)
2801        string - that was checked before setting g_notempty.        string - that was checked before setting g_notempty.
2802    
2803        Complication arises in the case when the newline convention is "any",        Complication arises in the case when the newline convention is "any",
2804        "crlf", or "anycrlf". If the previous match was at the end of a line        "crlf", or "anycrlf". If the previous match was at the end of a line
2805        terminated by CRLF, an advance of one character just passes the \r,        terminated by CRLF, an advance of one character just passes the \r,
2806        whereas we should prefer the longer newline sequence, as does the code in        whereas we should prefer the longer newline sequence, as does the code in
2807        pcre_exec(). Fudge the offset value to achieve this. We check for a        pcre_exec(). Fudge the offset value to achieve this. We check for a
2808        newline setting in the pattern; if none was set, use pcre_config() to        newline setting in the pattern; if none was set, use pcre_config() to
2809        find the default.        find the default.
2810    
2811        Otherwise, in the case of UTF-8 matching, the advance must be one        Otherwise, in the case of UTF-8 matching, the advance must be one
# Line 2841  while (!done) Line 2843  while (!done)
2843              while (start_offset + onechar < len)              while (start_offset + onechar < len)
2844                {                {
2845                if ((bptr[start_offset+onechar] & 0xc0) != 0x80) break;                if ((bptr[start_offset+onechar] & 0xc0) != 0x80) break;
2846                onechar++;                onechar++;
2847                }                }
2848              }              }
2849            use_offsets[1] = start_offset + onechar;            use_offsets[1] = start_offset + onechar;

Legend:
Removed from v.567  
changed lines
  Added in v.579

  ViewVC Help
Powered by ViewVC 1.1.5