/[pcre]/code/branches/pcre16/pcre_printint.src
ViewVC logotype

Diff of /code/branches/pcre16/pcre_printint.src

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

revision 769 by zherczeg, Sun Nov 27 17:40:33 2011 UTC revision 770 by zherczeg, Mon Nov 28 20:39:30 2011 UTC
# Line 471  for(;;) Line 471  for(;;)
471      fprintf(f, "    %s %s", OP_names[*code], get_ucpname(code[1], code[2]));      fprintf(f, "    %s %s", OP_names[*code], get_ucpname(code[1], code[2]));
472      break;      break;
473    
474      /* OP_XCLASS can only occur in UTF-8 mode. However, there's no harm in      /* OP_XCLASS can only occur in UTF or PCRE16 modes. However, there's no
475      having this code always here, and it makes it less messy without all those      harm in having this code always here, and it makes it less messy without
476      #ifdefs. */      all those #ifdefs. */
477    
478      case OP_CLASS:      case OP_CLASS:
479      case OP_NCLASS:      case OP_NCLASS:
# Line 481  for(;;) Line 481  for(;;)
481        {        {
482        int i, min, max;        int i, min, max;
483        BOOL printmap;        BOOL printmap;
484          pcre_uint8 *map;
485    
486        fprintf(f, "    [");        fprintf(f, "    [");
487    
# Line 501  for(;;) Line 502  for(;;)
502    
503        if (printmap)        if (printmap)
504          {          {
505            map = (pcre_uint8 *)ccode;
506          for (i = 0; i < 256; i++)          for (i = 0; i < 256; i++)
507            {            {
508            if ((ccode[i/8] & (1 << (i&7))) != 0)            if ((map[i/8] & (1 << (i&7))) != 0)
509              {              {
510              int j;              int j;
511              for (j = i+1; j < 256; j++)              for (j = i+1; j < 256; j++)
512                if ((ccode[j/8] & (1 << (j&7))) == 0) break;                if ((map[j/8] & (1 << (j&7))) == 0) break;
513              if (i == '-' || i == ']') fprintf(f, "\\");              if (i == '-' || i == ']') fprintf(f, "\\");
514              if (PRINTABLE(i)) fprintf(f, "%c", i);              if (PRINTABLE(i)) fprintf(f, "%c", i);
515                else fprintf(f, "\\x%02x", i);                else fprintf(f, "\\x%02x", i);
# Line 521  for(;;) Line 523  for(;;)
523              i = j;              i = j;
524              }              }
525            }            }
526          ccode += 32;          ccode += 32 / sizeof(pcre_uchar);
527          }          }
528    
529        /* For an XCLASS there is always some additional data */        /* For an XCLASS there is always some additional data */

Legend:
Removed from v.769  
changed lines
  Added in v.770

  ViewVC Help
Powered by ViewVC 1.1.5