/[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 616 by ph10, Mon Jul 11 15:55:25 2011 UTC revision 626 by ph10, Wed Jul 20 17:51:54 2011 UTC
# Line 1434  while (!done) Line 1434  while (!done)
1434    const unsigned char *tables = NULL;    const unsigned char *tables = NULL;
1435    unsigned long int true_size, true_study_size = 0;    unsigned long int true_size, true_study_size = 0;
1436    size_t size, regex_gotten_store;    size_t size, regex_gotten_store;
1437      int do_allcaps = 0;
1438    int do_mark = 0;    int do_mark = 0;
1439    int do_study = 0;    int do_study = 0;
1440    int no_force_study = 0;    int no_force_study = 0;
# Line 1611  while (!done) Line 1612  while (!done)
1612        case '+':        case '+':
1613        if (do_showrest) do_showcaprest = 1; else do_showrest = 1;        if (do_showrest) do_showcaprest = 1; else do_showrest = 1;
1614        break;        break;
1615    
1616          case '=': do_allcaps = 1; break;
1617        case 'A': options |= PCRE_ANCHORED; break;        case 'A': options |= PCRE_ANCHORED; break;
1618        case 'B': do_debug = 1; break;        case 'B': do_debug = 1; break;
1619        case 'C': options |= PCRE_AUTO_CALLOUT; break;        case 'C': options |= PCRE_AUTO_CALLOUT; break;
# Line 2734  while (!done) Line 2736  while (!done)
2736              do_g = do_G = FALSE;        /* Break g/G loop */              do_g = do_G = FALSE;        /* Break g/G loop */
2737              }              }
2738            }            }
2739    
2740            /* do_allcaps requests showing of all captures in the pattern, to check
2741            unset ones at the end. */
2742    
2743            if (do_allcaps)
2744              {
2745              new_info(re, NULL, PCRE_INFO_CAPTURECOUNT, &count);
2746              count++;   /* Allow for full match */
2747              if (count * 2 > use_size_offsets) count = use_size_offsets/2;
2748              }
2749    
2750            /* Output the captured substrings */
2751    
2752          for (i = 0; i < count * 2; i += 2)          for (i = 0; i < count * 2; i += 2)
2753            {            {
2754            if (use_offsets[i] < 0)            if (use_offsets[i] < 0)
2755                {
2756                if (use_offsets[i] != -1)
2757                  fprintf(outfile, "ERROR: bad negative value %d for offset %d\n",
2758                    use_offsets[i], i);
2759                if (use_offsets[i+1] != -1)
2760                  fprintf(outfile, "ERROR: bad negative value %d for offset %d\n",
2761                    use_offsets[i+1], i+1);
2762              fprintf(outfile, "%2d: <unset>\n", i/2);              fprintf(outfile, "%2d: <unset>\n", i/2);
2763                }
2764            else            else
2765              {              {
2766              fprintf(outfile, "%2d: ", i/2);              fprintf(outfile, "%2d: ", i/2);

Legend:
Removed from v.616  
changed lines
  Added in v.626

  ViewVC Help
Powered by ViewVC 1.1.5