/[pcre]/code/trunk/pcre_printint.src
ViewVC logotype

Diff of /code/trunk/pcre_printint.src

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

revision 579 by ph10, Wed Nov 24 17:39:25 2010 UTC revision 602 by ph10, Wed May 25 08:29:03 2011 UTC
# Line 180  utf8 = (options & PCRE_UTF8) != 0; Line 180  utf8 = (options & PCRE_UTF8) != 0;
180  for(;;)  for(;;)
181    {    {
182    uschar *ccode;    uschar *ccode;
183      const char *flag = "  ";
184    int c;    int c;
185    int extra = 0;    int extra = 0;
186    
# Line 214  for(;;) Line 215  for(;;)
215      fprintf(f, "------------------------------------------------------------------\n");      fprintf(f, "------------------------------------------------------------------\n");
216      return;      return;
217    
     case OP_OPT:  
     fprintf(f, " %.2x %s", code[1], OP_names[*code]);  
     break;  
   
218      case OP_CHAR:      case OP_CHAR:
219      fprintf(f, "    ");      fprintf(f, "    ");
220      do      do
# Line 229  for(;;) Line 226  for(;;)
226      fprintf(f, "\n");      fprintf(f, "\n");
227      continue;      continue;
228    
229      case OP_CHARNC:      case OP_CHARI:
230      fprintf(f, " NC ");      fprintf(f, " /i ");
231      do      do
232        {        {
233        code++;        code++;
234        code += 1 + print_char(f, code, utf8);        code += 1 + print_char(f, code, utf8);
235        }        }
236      while (*code == OP_CHARNC);      while (*code == OP_CHARI);
237      fprintf(f, "\n");      fprintf(f, "\n");
238      continue;      continue;
239    
# Line 295  for(;;) Line 292  for(;;)
292      fprintf(f, "    Cond def");      fprintf(f, "    Cond def");
293      break;      break;
294    
295        case OP_STARI:
296        case OP_MINSTARI:
297        case OP_POSSTARI:
298        case OP_PLUSI:
299        case OP_MINPLUSI:
300        case OP_POSPLUSI:
301        case OP_QUERYI:
302        case OP_MINQUERYI:
303        case OP_POSQUERYI:
304        flag = "/i";
305        /* Fall through */
306      case OP_STAR:      case OP_STAR:
307      case OP_MINSTAR:      case OP_MINSTAR:
308      case OP_POSSTAR:      case OP_POSSTAR:
# Line 313  for(;;) Line 321  for(;;)
321      case OP_TYPEQUERY:      case OP_TYPEQUERY:
322      case OP_TYPEMINQUERY:      case OP_TYPEMINQUERY:
323      case OP_TYPEPOSQUERY:      case OP_TYPEPOSQUERY:
324      fprintf(f, "    ");      fprintf(f, " %s ", flag);
325      if (*code >= OP_TYPESTAR)      if (*code >= OP_TYPESTAR)
326        {        {
327        fprintf(f, "%s", OP_names[code[1]]);        fprintf(f, "%s", OP_names[code[1]]);
# Line 327  for(;;) Line 335  for(;;)
335      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
336      break;      break;
337    
338        case OP_EXACTI:
339        case OP_UPTOI:
340        case OP_MINUPTOI:
341        case OP_POSUPTOI:
342        flag = "/i";
343        /* Fall through */
344      case OP_EXACT:      case OP_EXACT:
345      case OP_UPTO:      case OP_UPTO:
346      case OP_MINUPTO:      case OP_MINUPTO:
347      case OP_POSUPTO:      case OP_POSUPTO:
348      fprintf(f, "    ");      fprintf(f, " %s ", flag);
349      extra = print_char(f, code+3, utf8);      extra = print_char(f, code+3, utf8);
350      fprintf(f, "{");      fprintf(f, "{");
351      if (*code != OP_EXACT) fprintf(f, "0,");      if (*code != OP_EXACT && *code != OP_EXACTI) fprintf(f, "0,");
352      fprintf(f, "%d}", GET2(code,1));      fprintf(f, "%d}", GET2(code,1));
353      if (*code == OP_MINUPTO) fprintf(f, "?");      if (*code == OP_MINUPTO || *code == OP_MINUPTOI) fprintf(f, "?");
354        else if (*code == OP_POSUPTO) fprintf(f, "+");        else if (*code == OP_POSUPTO || *code == OP_POSUPTOI) fprintf(f, "+");
355      break;      break;
356    
357      case OP_TYPEEXACT:      case OP_TYPEEXACT:
# Line 357  for(;;) Line 371  for(;;)
371        else if (*code == OP_TYPEPOSUPTO) fprintf(f, "+");        else if (*code == OP_TYPEPOSUPTO) fprintf(f, "+");
372      break;      break;
373    
374        case OP_NOTI:
375        flag = "/i";
376        /* Fall through */
377      case OP_NOT:      case OP_NOT:
378      c = code[1];      c = code[1];
379      if (PRINTABLE(c)) fprintf(f, "    [^%c]", c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
380        else fprintf(f, "    [^\\x%02x]", c);        else fprintf(f, " %s [^\\x%02x]", flag, c);
381      break;      break;
382    
383        case OP_NOTSTARI:
384        case OP_NOTMINSTARI:
385        case OP_NOTPOSSTARI:
386        case OP_NOTPLUSI:
387        case OP_NOTMINPLUSI:
388        case OP_NOTPOSPLUSI:
389        case OP_NOTQUERYI:
390        case OP_NOTMINQUERYI:
391        case OP_NOTPOSQUERYI:
392        flag = "/i";
393        /* Fall through */
394    
395      case OP_NOTSTAR:      case OP_NOTSTAR:
396      case OP_NOTMINSTAR:      case OP_NOTMINSTAR:
397      case OP_NOTPOSSTAR:      case OP_NOTPOSSTAR:
# Line 373  for(;;) Line 402  for(;;)
402      case OP_NOTMINQUERY:      case OP_NOTMINQUERY:
403      case OP_NOTPOSQUERY:      case OP_NOTPOSQUERY:
404      c = code[1];      c = code[1];
405      if (PRINTABLE(c)) fprintf(f, "    [^%c]", c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
406        else fprintf(f, "    [^\\x%02x]", c);        else fprintf(f, " %s [^\\x%02x]", flag, c);
407      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
408      break;      break;
409    
410        case OP_NOTEXACTI:
411        case OP_NOTUPTOI:
412        case OP_NOTMINUPTOI:
413        case OP_NOTPOSUPTOI:
414        flag = "/i";
415        /* Fall through */
416    
417      case OP_NOTEXACT:      case OP_NOTEXACT:
418      case OP_NOTUPTO:      case OP_NOTUPTO:
419      case OP_NOTMINUPTO:      case OP_NOTMINUPTO:
420      case OP_NOTPOSUPTO:      case OP_NOTPOSUPTO:
421      c = code[3];      c = code[3];
422      if (PRINTABLE(c)) fprintf(f, "    [^%c]{", c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]{", flag, c);
423        else fprintf(f, "    [^\\x%02x]{", c);        else fprintf(f, " %s [^\\x%02x]{", flag, c);
424      if (*code != OP_NOTEXACT) fprintf(f, "0,");      if (*code != OP_NOTEXACT && *code != OP_NOTEXACTI) fprintf(f, "0,");
425      fprintf(f, "%d}", GET2(code,1));      fprintf(f, "%d}", GET2(code,1));
426      if (*code == OP_NOTMINUPTO) fprintf(f, "?");      if (*code == OP_NOTMINUPTO || *code == OP_NOTMINUPTOI) fprintf(f, "?");
427        else if (*code == OP_NOTPOSUPTO) fprintf(f, "+");        else
428        if (*code == OP_NOTPOSUPTO || *code == OP_NOTPOSUPTOI) fprintf(f, "+");
429      break;      break;
430    
431      case OP_RECURSE:      case OP_RECURSE:
# Line 397  for(;;) Line 434  for(;;)
434      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
435      break;      break;
436    
437        case OP_REFI:
438        flag = "/i";
439        /* Fall through */
440      case OP_REF:      case OP_REF:
441      fprintf(f, "    \\%d", GET2(code,1));      fprintf(f, " %s \\%d", flag, GET2(code,1));
442      ccode = code + _pcre_OP_lengths[*code];      ccode = code + _pcre_OP_lengths[*code];
443      goto CLASS_REF_REPEAT;      goto CLASS_REF_REPEAT;
444    
# Line 556  for(;;) Line 596  for(;;)
596        fprintf(f, "    %s %s", OP_names[*code], code + 2 + LINK_SIZE);        fprintf(f, "    %s %s", OP_names[*code], code + 2 + LINK_SIZE);
597      extra += code[1+LINK_SIZE];      extra += code[1+LINK_SIZE];
598      break;      break;
599    
600      /* Anything else is just an item with no data*/      case OP_CIRCM:
601        case OP_DOLLM:
602        flag = "/m";
603        /* Fall through */
604    
605        /* Anything else is just an item with no data, but possibly a flag. */
606    
607      default:      default:
608      fprintf(f, "    %s", OP_names[*code]);      fprintf(f, " %s %s", flag, OP_names[*code]);
609      break;      break;
610      }      }
611    

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12