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

Diff of /code/trunk/pcre_printint.c

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

revision 906 by zherczeg, Tue Jan 24 09:55:16 2012 UTC revision 1045 by ph10, Sun Sep 23 16:50:00 2012 UTC
# Line 130  return 0; Line 130  return 0;
130    
131  if (!utf || (c & 0xc0) != 0xc0)  if (!utf || (c & 0xc0) != 0xc0)
132    {    {
133    if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);    if (PRINTABLE(c)) fprintf(f, "%c", c);
134      else if (c < 0x80) fprintf(f, "\\x%02x", c);
135      else fprintf(f, "\\x{%02x}", c);
136    return 0;    return 0;
137    }    }
138  else  else
# Line 167  else Line 169  else
169  if (!utf || (c & 0xfc00) != 0xd800)  if (!utf || (c & 0xfc00) != 0xd800)
170    {    {
171    if (PRINTABLE(c)) fprintf(f, "%c", c);    if (PRINTABLE(c)) fprintf(f, "%c", c);
172    else if (c <= 0xff) fprintf(f, "\\x%02x", c);    else if (c <= 0x80) fprintf(f, "\\x%02x", c);
173    else fprintf(f, "\\x{%x}", c);    else fprintf(f, "\\x{%02x}", c);
174    return 0;    return 0;
175    }    }
176  else  else
# Line 477  for(;;) Line 479  for(;;)
479      flag = "/i";      flag = "/i";
480      /* Fall through */      /* Fall through */
481      case OP_NOT:      case OP_NOT:
482      c = code[1];      fprintf(f, " %s [^", flag);
483      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);      extra = print_char(f, code + 1, utf);
484      else if (utf || c > 0xff)      fprintf(f, "]");
       fprintf(f, " %s [^\\x{%02x}]", flag, c);  
     else  
       fprintf(f, " %s [^\\x%02x]", flag, c);  
485      break;      break;
486    
487      case OP_NOTSTARI:      case OP_NOTSTARI:
# Line 506  for(;;) Line 505  for(;;)
505      case OP_NOTQUERY:      case OP_NOTQUERY:
506      case OP_NOTMINQUERY:      case OP_NOTMINQUERY:
507      case OP_NOTPOSQUERY:      case OP_NOTPOSQUERY:
508      c = code[1];      fprintf(f, " %s [^", flag);
509      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);      extra = print_char(f, code + 1, utf);
510        else fprintf(f, " %s [^\\x%02x]", flag, c);      fprintf(f, "]%s", priv_OP_names[*code]);
     fprintf(f, "%s", priv_OP_names[*code]);  
511      break;      break;
512    
513      case OP_NOTEXACTI:      case OP_NOTEXACTI:
# Line 523  for(;;) Line 521  for(;;)
521      case OP_NOTUPTO:      case OP_NOTUPTO:
522      case OP_NOTMINUPTO:      case OP_NOTMINUPTO:
523      case OP_NOTPOSUPTO:      case OP_NOTPOSUPTO:
524      c = code[1 + IMM2_SIZE];      fprintf(f, " %s [^", flag);
525      if (PRINTABLE(c)) fprintf(f, " %s [^%c]{", flag, c);      extra = print_char(f, code + 1 + IMM2_SIZE, utf);
526        else fprintf(f, " %s [^\\x%02x]{", flag, c);      fprintf(f, "]{");
527      if (*code != OP_NOTEXACT && *code != OP_NOTEXACTI) fprintf(f, "0,");      if (*code != OP_NOTEXACT && *code != OP_NOTEXACTI) fprintf(f, "0,");
528      fprintf(f, "%d}", GET2(code,1));      fprintf(f, "%d}", GET2(code,1));
529      if (*code == OP_NOTMINUPTO || *code == OP_NOTMINUPTOI) fprintf(f, "?");      if (*code == OP_NOTMINUPTO || *code == OP_NOTMINUPTOI) fprintf(f, "?");

Legend:
Removed from v.906  
changed lines
  Added in v.1045

  ViewVC Help
Powered by ViewVC 1.1.5