/[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 117 by ph10, Fri Mar 9 15:59:06 2007 UTC revision 305 by ph10, Sun Jan 20 20:07:32 2008 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-2008 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 122  get_ucpname(int ptype, int pvalue) Line 122  get_ucpname(int ptype, int pvalue)
122  {  {
123  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
124  int i;  int i;
125  for (i = _pcre_utt_size; i >= 0; i--)  for (i = _pcre_utt_size - 1; i >= 0; i--)
126    {    {
127    if (ptype == _pcre_utt[i].type && pvalue == _pcre_utt[i].value) break;    if (ptype == _pcre_utt[i].type && pvalue == _pcre_utt[i].value) break;
128    }    }
129  return (i >= 0)? _pcre_utt[i].name : "??";  return (i >= 0)? _pcre_utt_names + _pcre_utt[i].name_offset : "??";
130  #else  #else
131  /* It gets harder and harder to shut off unwanted compiler warnings. */  /* It gets harder and harder to shut off unwanted compiler warnings. */
132  ptype = ptype * pvalue;  ptype = ptype * pvalue;
# Line 142  return (ptype == pvalue)? "??" : "??"; Line 142  return (ptype == pvalue)? "??" : "??";
142    
143  /* Make this function work for a regex with integers either byte order.  /* Make this function work for a regex with integers either byte order.
144  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
145  print_lengths flag controls whether offsets and lengths of items are printed.  print_lengths flag controls whether offsets and lengths of items are printed.
146  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
147  written that do not depend on the value of LINK_SIZE. */  written that do not depend on the value of LINK_SIZE. */
148    
# Line 181  for(;;) Line 181  for(;;)
181    if (print_lengths)    if (print_lengths)
182      fprintf(f, "%3d ", (int)(code - codestart));      fprintf(f, "%3d ", (int)(code - codestart));
183    else    else
184      fprintf(f, "    ");      fprintf(f, "    ");
185    
186    switch(*code)    switch(*code)
187      {      {
# Line 219  for(;;) Line 219  for(;;)
219      case OP_CBRA:      case OP_CBRA:
220      case OP_SCBRA:      case OP_SCBRA:
221      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
222        else fprintf(f, "    ");        else fprintf(f, "    ");
223      fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE));      fprintf(f, "%s %d", OP_names[*code], GET2(code, 1+LINK_SIZE));
224      break;      break;
225    
# Line 238  for(;;) Line 238  for(;;)
238      case OP_SCOND:      case OP_SCOND:
239      case OP_REVERSE:      case OP_REVERSE:
240      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
241        else fprintf(f, "    ");        else fprintf(f, "    ");
242      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
243      break;      break;
244    
# Line 356  for(;;) Line 356  for(;;)
356    
357      case OP_RECURSE:      case OP_RECURSE:
358      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));      if (print_lengths) fprintf(f, "%3d ", GET(code, 1));
359        else fprintf(f, "    ");        else fprintf(f, "    ");
360      fprintf(f, "%s", OP_names[*code]);      fprintf(f, "%s", OP_names[*code]);
361      break;      break;
362    

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

  ViewVC Help
Powered by ViewVC 1.1.5