/[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

code/trunk/pcre_printint.src revision 117 by ph10, Fri Mar 9 15:59:06 2007 UTC code/branches/pcre16/pcre_printint.src revision 770 by zherczeg, Mon Nov 28 20:39:30 2011 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2007 University of Cambridge             Copyright (c) 1997-2010 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 43  internal form of a compiled regular expr Line 43  internal form of a compiled regular expr
43  local functions. This source file is used in two places:  local functions. This source file is used in two places:
44    
45  (1) It is #included by pcre_compile.c when it is compiled in debugging mode  (1) It is #included by pcre_compile.c when it is compiled in debugging mode
46  (DEBUG defined in pcre_internal.h). It is not included in production compiles.  (PCRE_DEBUG defined in pcre_internal.h). It is not included in production
47    compiles.
48    
49  (2) It is always #included by pcretest.c, which can be asked to print out a  (2) It is always #included by pcretest.c, which can be asked to print out a
50  compiled regex for debugging purposes. */  compiled regex for debugging purposes. */
# Line 54  hexadecimal. We don't use isprint() beca Line 55  hexadecimal. We don't use isprint() beca
55  (even without the use of locales) and we want the output always to be the same,  (even without the use of locales) and we want the output always to be the same,
56  for testing purposes. This macro is used in pcretest as well as in this file. */  for testing purposes. This macro is used in pcretest as well as in this file. */
57    
58    #ifdef EBCDIC
59    #define PRINTABLE(c) ((c) >= 64 && (c) < 255)
60    #else
61  #define PRINTABLE(c) ((c) >= 32 && (c) < 127)  #define PRINTABLE(c) ((c) >= 32 && (c) < 127)
62    #endif
63    
64  /* The table of operator names. */  /* The table of operator names. */
65    
# Line 67  static const char *OP_names[] = { OP_NAM Line 72  static const char *OP_names[] = { OP_NAM
72  *************************************************/  *************************************************/
73    
74  static int  static int
75  print_char(FILE *f, uschar *ptr, BOOL utf8)  print_char(FILE *f, pcre_uchar *ptr, BOOL utf8)
76  {  {
77  int c = *ptr;  int c = *ptr;
78    
79  #ifndef SUPPORT_UTF8  #ifndef SUPPORT_UTF8
80  utf8 = utf8;  /* Avoid compiler warning */  (void)utf8;  /* Avoid compiler warning */
81  if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);  if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x%02x", c);
82  return 0;  return 0;
83    
# Line 85  if (!utf8 || (c & 0xc0) != 0xc0) Line 90  if (!utf8 || (c & 0xc0) != 0xc0)
90  else  else
91    {    {
92    int i;    int i;
93    int a = _pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */    int a = PRIV(utf8_table4)[c & 0x3f];  /* Number of additional bytes */
94    int s = 6*a;    int s = 6*a;
95    c = (c & _pcre_utf8_table3[a]) << s;    c = (c & PRIV(utf8_table3)[a]) << s;
96    for (i = 1; i <= a; i++)    for (i = 1; i <= a; i++)
97      {      {
98      /* This is a check for malformed UTF-8; it should only occur if the sanity      /* This is a check for malformed UTF-8; it should only occur if the sanity
# Line 111  else Line 116  else
116  #endif  #endif
117  }  }
118    
119    /*************************************************
120    *  Print uchar string (regardless of utf8)       *
121    *************************************************/
122    
123    static void
124    print_puchar(FILE *f, PCRE_PUCHAR ptr)
125    {
126    while (*ptr != '\0')
127      {
128      register int c = *ptr++;
129      if (PRINTABLE(c)) fprintf(f, "%c", c); else fprintf(f, "\\x{%x}", c);
130      }
131    }
132    
133  /*************************************************  /*************************************************
134  *          Find Unicode property name            *  *          Find Unicode property name            *
# Line 122  get_ucpname(int ptype, int pvalue) Line 139  get_ucpname(int ptype, int pvalue)
139  {  {
140  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
141  int i;  int i;
142  for (i = _pcre_utt_size; i >= 0; i--)  for (i = PRIV(utt_size) - 1; i >= 0; i--)
143    {    {
144    if (ptype == _pcre_utt[i].type && pvalue == _pcre_utt[i].value) break;    if (ptype == PRIV(utt)[i].type && pvalue == PRIV(utt)[i].value) break;
145    }    }
146  return (i >= 0)? _pcre_utt[i].name : "??";  return (i >= 0)? PRIV(utt_names) + PRIV(utt)[i].name_offset : "??";
147  #else  #else
148  /* It gets harder and harder to shut off unwanted compiler warnings. */  /* It gets harder and harder to shut off unwanted compiler warnings. */
149  ptype = ptype * pvalue;  ptype = ptype * pvalue;
# Line 142  return (ptype == pvalue)? "??" : "??"; Line 159  return (ptype == pvalue)? "??" : "??";
159    
160  /* Make this function work for a regex with integers either byte order.  /* Make this function work for a regex with integers either byte order.
161  However, we assume that what we are passed is a compiled regex. The  However, we assume that what we are passed is a compiled regex. The
162  print_lengths flag controls whether offsets and lengths of items are printed.  print_lengths flag controls whether offsets and lengths of items are printed.
163  They can be turned off from pcretest so that automatic tests on bytecode can be  They can be turned off from pcretest so that automatic tests on bytecode can be
164  written that do not depend on the value of LINK_SIZE. */  written that do not depend on the value of LINK_SIZE. */
165    
# Line 150  static void Line 167  static void
167  pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths)  pcre_printint(pcre *external_re, FILE *f, BOOL print_lengths)
168  {  {
169  real_pcre *re = (real_pcre *)external_re;  real_pcre *re = (real_pcre *)external_re;
170  uschar *codestart, *code;  pcre_uchar *codestart, *code;
171  BOOL utf8;  BOOL utf8;
172    
173  unsigned int options = re->options;  unsigned int options = re->options;
# Line 169  if (re->magic_number != MAGIC_NUMBER) Line 186  if (re->magic_number != MAGIC_NUMBER)
186              ((options >> 24) & 0x000000ff);              ((options >> 24) & 0x000000ff);
187    }    }
188    
189  code = codestart = (uschar *)re + offset + count * size;  code = codestart = (pcre_uchar *)re + offset + count * size;
190  utf8 = (options & PCRE_UTF8) != 0;  utf8 = (options & PCRE_UTF8) != 0;
191    
192  for(;;)  for(;;)
193    {    {
194    uschar *ccode;    pcre_uchar *ccode;
195      const char *flag = "  ";
196    int c;    int c;
197    int extra = 0;    int extra = 0;
198    
199    if (print_lengths)    if (print_lengths)
200      fprintf(f, "%3d ", (int)(code - codestart));      fprintf(f, "%3d ", (int)(code - codestart));
201    else    else
202      fprintf(f, "    ");      fprintf(f, "    ");
203    
204    switch(*code)    switch(*code)
205      {      {
206    /* ========================================================================== */
207          /* These cases are never obeyed. This is a fudge that causes a compile-
208          time error if the vectors OP_names or PRIV(OP_lengths), which are indexed
209          by opcode, are not the correct length. It seems to be the only way to do
210          such a check at compile time, as the sizeof() operator does not work in
211          the C preprocessor. We do this while compiling pcretest, because that
212          #includes pcre_tables.c, which holds PRIV(OP_lengths). We can't do this
213          when building pcre_compile.c with PCRE_DEBUG set, because it doesn't then
214          know the size of PRIV(OP_lengths). */
215    
216    #ifdef COMPILING_PCRETEST
217          case OP_TABLE_LENGTH:
218          case OP_TABLE_LENGTH +
219            ((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&
220            (sizeof(PRIV(OP_lengths)) == OP_TABLE_LENGTH)):
221          break;
222    #endif
223    /* ========================================================================== */
224    
225      case OP_END:      case OP_END:
226      fprintf(f, "    %s\n", OP_names[*code]);      fprintf(f, "    %s\n", OP_names[*code]);
227      fprintf(f, "------------------------------------------------------------------\n");      fprintf(f, "------------------------------------------------------------------\n");
228      return;      return;
229    
     case OP_OPT:  
     fprintf(f, " %.2x %s", code[1], OP_names[*code]);  
     break;  
   
230      case OP_CHAR:      case OP_CHAR:
231      fprintf(f, "    ");      fprintf(f, "    ");
232      do      do
# Line 205  for(;;) Line 238  for(;;)
238      fprintf(f, "\n");      fprintf(f, "\n");
239      continue;      continue;
240    
241      case OP_CHARNC:      case OP_CHARI:
242      fprintf(f, " NC ");      fprintf(f, " /i ");
243      do      do
244        {        {
245        code++;        code++;
246        code += 1 + print_char(f, code, utf8);        code += 1 + print_char(f, code, utf8);
247        }        }
248      while (*code == OP_CHARNC);      while (*code == OP_CHARI);
249      fprintf(f, "\n");      fprintf(f, "\n");
250      continue;      continue;
251    
252      case OP_CBRA:      case OP_CBRA:
253        case OP_CBRAPOS:
254      case OP_SCBRA:      case OP_SCBRA:
255        case OP_SCBRAPOS:
256      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
257        else fprintf(f, "    ");        else fprintf(f, "    ");
258      fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE));      fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE));
259      break;      break;
260    
261      case OP_BRA:      case OP_BRA:
262        case OP_BRAPOS:
263      case OP_SBRA:      case OP_SBRA:
264        case OP_SBRAPOS:
265      case OP_KETRMAX:      case OP_KETRMAX:
266      case OP_KETRMIN:      case OP_KETRMIN:
267        case OP_KETRPOS:
268      case OP_ALT:      case OP_ALT:
269      case OP_KET:      case OP_KET:
270      case OP_ASSERT:      case OP_ASSERT:
# Line 234  for(;;) Line 272  for(;;)
272      case OP_ASSERTBACK:      case OP_ASSERTBACK:
273      case OP_ASSERTBACK_NOT:      case OP_ASSERTBACK_NOT:
274      case OP_ONCE:      case OP_ONCE:
275        case OP_ONCE_NC:
276      case OP_COND:      case OP_COND:
277      case OP_SCOND:      case OP_SCOND:
278      case OP_REVERSE:      case OP_REVERSE:
279      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
280        else fprintf(f, "    ");        else fprintf(f, "    ");
281      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
282      break;      break;
283    
284        case OP_CLOSE:
285        fprintf(f, "    %s %d", OP_names[*code], GET2(code, 1));
286        break;
287    
288      case OP_CREF:      case OP_CREF:
289        case OP_NCREF:
290      fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);      fprintf(f, "%3d %s", GET2(code,1), OP_names[*code]);
291      break;      break;
292    
# Line 254  for(;;) Line 298  for(;;)
298        fprintf(f, "    Cond recurse %d", c);        fprintf(f, "    Cond recurse %d", c);
299      break;      break;
300    
301        case OP_NRREF:
302        c = GET2(code, 1);
303        if (c == RREF_ANY)
304          fprintf(f, "    Cond nrecurse any");
305        else
306          fprintf(f, "    Cond nrecurse %d", c);
307        break;
308    
309      case OP_DEF:      case OP_DEF:
310      fprintf(f, "    Cond def");      fprintf(f, "    Cond def");
311      break;      break;
312    
313        case OP_STARI:
314        case OP_MINSTARI:
315        case OP_POSSTARI:
316        case OP_PLUSI:
317        case OP_MINPLUSI:
318        case OP_POSPLUSI:
319        case OP_QUERYI:
320        case OP_MINQUERYI:
321        case OP_POSQUERYI:
322        flag = "/i";
323        /* Fall through */
324      case OP_STAR:      case OP_STAR:
325      case OP_MINSTAR:      case OP_MINSTAR:
326      case OP_POSSTAR:      case OP_POSSTAR:
# Line 276  for(;;) Line 339  for(;;)
339      case OP_TYPEQUERY:      case OP_TYPEQUERY:
340      case OP_TYPEMINQUERY:      case OP_TYPEMINQUERY:
341      case OP_TYPEPOSQUERY:      case OP_TYPEPOSQUERY:
342      fprintf(f, "    ");      fprintf(f, " %s ", flag);
343      if (*code >= OP_TYPESTAR)      if (*code >= OP_TYPESTAR)
344        {        {
345        fprintf(f, "%s", OP_names[code[1]]);        fprintf(f, "%s", OP_names[code[1]]);
# Line 290  for(;;) Line 353  for(;;)
353      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
354      break;      break;
355    
356        case OP_EXACTI:
357        case OP_UPTOI:
358        case OP_MINUPTOI:
359        case OP_POSUPTOI:
360        flag = "/i";
361        /* Fall through */
362      case OP_EXACT:      case OP_EXACT:
363      case OP_UPTO:      case OP_UPTO:
364      case OP_MINUPTO:      case OP_MINUPTO:
365      case OP_POSUPTO:      case OP_POSUPTO:
366      fprintf(f, "    ");      fprintf(f, " %s ", flag);
367      extra = print_char(f, code+3, utf8);      extra = print_char(f, code + 1 + IMM2_SIZE, utf8);
368      fprintf(f, "{");      fprintf(f, "{");
369      if (*code != OP_EXACT) fprintf(f, "0,");      if (*code != OP_EXACT && *code != OP_EXACTI) fprintf(f, "0,");
370      fprintf(f, "%d}", GET2(code,1));      fprintf(f, "%d}", GET2(code,1));
371      if (*code == OP_MINUPTO) fprintf(f, "?");      if (*code == OP_MINUPTO || *code == OP_MINUPTOI) fprintf(f, "?");
372        else if (*code == OP_POSUPTO) fprintf(f, "+");        else if (*code == OP_POSUPTO || *code == OP_POSUPTOI) fprintf(f, "+");
373      break;      break;
374    
375      case OP_TYPEEXACT:      case OP_TYPEEXACT:
376      case OP_TYPEUPTO:      case OP_TYPEUPTO:
377      case OP_TYPEMINUPTO:      case OP_TYPEMINUPTO:
378      case OP_TYPEPOSUPTO:      case OP_TYPEPOSUPTO:
379      fprintf(f, "    %s", OP_names[code[3]]);      fprintf(f, "    %s", OP_names[code[1 + IMM2_SIZE]]);
380      if (code[3] == OP_PROP || code[3] == OP_NOTPROP)      if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP)
381        {        {
382        fprintf(f, " %s ", get_ucpname(code[4], code[5]));        fprintf(f, " %s ", get_ucpname(code[1 + IMM2_SIZE + 1],
383            code[1 + IMM2_SIZE + 2]));
384        extra = 2;        extra = 2;
385        }        }
386      fprintf(f, "{");      fprintf(f, "{");
# Line 320  for(;;) Line 390  for(;;)
390        else if (*code == OP_TYPEPOSUPTO) fprintf(f, "+");        else if (*code == OP_TYPEPOSUPTO) fprintf(f, "+");
391      break;      break;
392    
393        case OP_NOTI:
394        flag = "/i";
395        /* Fall through */
396      case OP_NOT:      case OP_NOT:
397      c = code[1];      c = code[1];
398      if (PRINTABLE(c)) fprintf(f, "    [^%c]", c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
399        else fprintf(f, "    [^\\x%02x]", c);        else fprintf(f, " %s [^\\x%02x]", flag, c);
400      break;      break;
401    
402        case OP_NOTSTARI:
403        case OP_NOTMINSTARI:
404        case OP_NOTPOSSTARI:
405        case OP_NOTPLUSI:
406        case OP_NOTMINPLUSI:
407        case OP_NOTPOSPLUSI:
408        case OP_NOTQUERYI:
409        case OP_NOTMINQUERYI:
410        case OP_NOTPOSQUERYI:
411        flag = "/i";
412        /* Fall through */
413    
414      case OP_NOTSTAR:      case OP_NOTSTAR:
415      case OP_NOTMINSTAR:      case OP_NOTMINSTAR:
416      case OP_NOTPOSSTAR:      case OP_NOTPOSSTAR:
# Line 336  for(;;) Line 421  for(;;)
421      case OP_NOTMINQUERY:      case OP_NOTMINQUERY:
422      case OP_NOTPOSQUERY:      case OP_NOTPOSQUERY:
423      c = code[1];      c = code[1];
424      if (PRINTABLE(c)) fprintf(f, "    [^%c]", c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]", flag, c);
425        else fprintf(f, "    [^\\x%02x]", c);        else fprintf(f, " %s [^\\x%02x]", flag, c);
426      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
427      break;      break;
428    
429        case OP_NOTEXACTI:
430        case OP_NOTUPTOI:
431        case OP_NOTMINUPTOI:
432        case OP_NOTPOSUPTOI:
433        flag = "/i";
434        /* Fall through */
435    
436      case OP_NOTEXACT:      case OP_NOTEXACT:
437      case OP_NOTUPTO:      case OP_NOTUPTO:
438      case OP_NOTMINUPTO:      case OP_NOTMINUPTO:
439      case OP_NOTPOSUPTO:      case OP_NOTPOSUPTO:
440      c = code[3];      c = code[1 + IMM2_SIZE];
441      if (PRINTABLE(c)) fprintf(f, "    [^%c]{", c);      if (PRINTABLE(c)) fprintf(f, " %s [^%c]{", flag, c);
442        else fprintf(f, "    [^\\x%02x]{", c);        else fprintf(f, " %s [^\\x%02x]{", flag, c);
443      if (*code != OP_NOTEXACT) fprintf(f, "0,");      if (*code != OP_NOTEXACT && *code != OP_NOTEXACTI) fprintf(f, "0,");
444      fprintf(f, "%d}", GET2(code,1));      fprintf(f, "%d}", GET2(code,1));
445      if (*code == OP_NOTMINUPTO) fprintf(f, "?");      if (*code == OP_NOTMINUPTO || *code == OP_NOTMINUPTOI) fprintf(f, "?");
446        else if (*code == OP_NOTPOSUPTO) fprintf(f, "+");        else
447        if (*code == OP_NOTPOSUPTO || *code == OP_NOTPOSUPTOI) fprintf(f, "+");
448      break;      break;
449    
450      case OP_RECURSE:      case OP_RECURSE:
451      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
452        else fprintf(f, "    ");        else fprintf(f, "    ");
453      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
454      break;      break;
455    
456        case OP_REFI:
457        flag = "/i";
458        /* Fall through */
459      case OP_REF:      case OP_REF:
460      fprintf(f, "    \\%d", GET2(code,1));      fprintf(f, " %s \\%d", flag, GET2(code,1));
461      ccode = code + _pcre_OP_lengths[*code];      ccode = code + PRIV(OP_lengths)[*code];
462      goto CLASS_REF_REPEAT;      goto CLASS_REF_REPEAT;
463    
464      case OP_CALLOUT:      case OP_CALLOUT:
# Line 375  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 385  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 405  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 425  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 */
# Line 475  for(;;) Line 573  for(;;)
573          case OP_CRQUERY:          case OP_CRQUERY:
574          case OP_CRMINQUERY:          case OP_CRMINQUERY:
575          fprintf(f, "%s", OP_names[*ccode]);          fprintf(f, "%s", OP_names[*ccode]);
576          extra += _pcre_OP_lengths[*ccode];          extra += PRIV(OP_lengths)[*ccode];
577          break;          break;
578    
579          case OP_CRRANGE:          case OP_CRRANGE:
580          case OP_CRMINRANGE:          case OP_CRMINRANGE:
581          min = GET2(ccode,1);          min = GET2(ccode,1);
582          max = GET2(ccode,3);          max = GET2(ccode,1 + IMM2_SIZE);
583          if (max == 0) fprintf(f, "{%d,}", min);          if (max == 0) fprintf(f, "{%d,}", min);
584          else fprintf(f, "{%d,%d}", min, max);          else fprintf(f, "{%d,%d}", min, max);
585          if (*ccode == OP_CRMINRANGE) fprintf(f, "?");          if (*ccode == OP_CRMINRANGE) fprintf(f, "?");
586          extra += _pcre_OP_lengths[*ccode];          extra += PRIV(OP_lengths)[*ccode];
587          break;          break;
588    
589          /* Do nothing if it's not a repeat; this code stops picky compilers          /* Do nothing if it's not a repeat; this code stops picky compilers
# Line 497  for(;;) Line 595  for(;;)
595        }        }
596      break;      break;
597    
598      /* Anything else is just an item with no data*/      case OP_MARK:
599        case OP_PRUNE_ARG:
600        case OP_SKIP_ARG:
601        case OP_THEN_ARG:
602        fprintf(f, "    %s ", OP_names[*code]);
603        print_puchar(f, code + 2);
604        extra += code[1];
605        break;
606    
607      default:      case OP_THEN:
608      fprintf(f, "    %s", OP_names[*code]);      fprintf(f, "    %s", OP_names[*code]);
609      break;      break;
610    
611        case OP_CIRCM:
612        case OP_DOLLM:
613        flag = "/m";
614        /* Fall through */
615    
616        /* Anything else is just an item with no data, but possibly a flag. */
617    
618        default:
619        fprintf(f, " %s %s", flag, OP_names[*code]);
620        break;
621      }      }
622    
623    code += _pcre_OP_lengths[*code] + extra;    code += PRIV(OP_lengths)[*code] + extra;
624    fprintf(f, "\n");    fprintf(f, "\n");
625    }    }
626  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.5