/[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 1137 by chpe, Thu Oct 18 19:08:11 2012 UTC revision 1221 by ph10, Sun Nov 11 20:27:03 2012 UTC
# Line 133  return 0; Line 133  return 0;
133    
134  if (!utf || (c & 0xc0) != 0xc0)  if (!utf || (c & 0xc0) != 0xc0)
135    {    {
136    if (PRINTABLE(c)) fprintf(f, "%c", (char)c);    if (PRINTABLE(c)) fprintf(f, "%c", (char)c);
137    else if (c < 0x80) fprintf(f, "\\x%02x", c);    else if (c < 0x80) fprintf(f, "\\x%02x", c);
138    else fprintf(f, "\\x{%02x}", c);    else fprintf(f, "\\x{%02x}", c);
139    return 0;    return 0;
# Line 254  return (ptype == pvalue)? "??" : "??"; Line 254  return (ptype == pvalue)? "??" : "??";
254  *       Print Unicode property value             *  *       Print Unicode property value             *
255  *************************************************/  *************************************************/
256    
257  /* "Normal" properties can be printed from tables. The PT_CLIST property is a  /* "Normal" properties can be printed from tables. The PT_CLIST property is a
258  pseudo-property that contains a pointer to a list of case-equivalent  pseudo-property that contains a pointer to a list of case-equivalent
259  characters. This is used only when UCP support is available and UTF mode is  characters. This is used only when UCP support is available and UTF mode is
260  selected. It should never occur otherwise, but just in case it does, have  selected. It should never occur otherwise, but just in case it does, have
261  something ready to print. */  something ready to print. */
262    
263  static void  static void
# Line 265  print_prop(FILE *f, pcre_uchar *code, co Line 265  print_prop(FILE *f, pcre_uchar *code, co
265  {  {
266  if (code[1] != PT_CLIST)  if (code[1] != PT_CLIST)
267    {    {
268    fprintf(f, "%s%s %s%s", before, priv_OP_names[*code], get_ucpname(code[1],    fprintf(f, "%s%s %s%s", before, priv_OP_names[*code], get_ucpname(code[1],
269      code[2]), after);      code[2]), after);
270    }    }
271  else  else
272    {    {
273    const char *not = (*code == OP_PROP)? "" : "not ";    const char *not = (*code == OP_PROP)? "" : "not ";
274  #ifndef SUPPORT_UCP  #ifndef SUPPORT_UCP
275    fprintf(f, "%s%sclist %d%s", before, not, code[2], after);    fprintf(f, "%s%sclist %d%s", before, not, code[2], after);
276  #else  #else
277    const pcre_uint32 *p = PRIV(ucd_caseless_sets) + code[2];    const pcre_uint32 *p = PRIV(ucd_caseless_sets) + code[2];
278    fprintf (f, "%s%sclist", before, not);    fprintf (f, "%s%sclist", before, not);
279    while (*p < NOTACHAR) fprintf(f, " %04x", *p++);    while (*p < NOTACHAR) fprintf(f, " %04x", *p++);
280    fprintf(f, "%s", after);    fprintf(f, "%s", after);
281  #endif  #endif
282    }    }
283  }  }
284    
285    

Legend:
Removed from v.1137  
changed lines
  Added in v.1221

  ViewVC Help
Powered by ViewVC 1.1.5