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

Diff of /code/trunk/pcre_study.c

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

revision 1403 by ph10, Mon Oct 14 13:54:07 2013 UTC revision 1404 by ph10, Tue Nov 19 15:36:57 2013 UTC
# Line 79  Returns:   the minimum length Line 79  Returns:   the minimum length
79  */  */
80    
81  static int  static int
82  find_minlength(const REAL_PCRE *re, const pcre_uchar *code,  find_minlength(const REAL_PCRE *re, const pcre_uchar *code,
83    const pcre_uchar *startcode, int options, int recurse_depth)    const pcre_uchar *startcode, int options, int recurse_depth)
84  {  {
85  int length = -1;  int length = -1;
# Line 379  for (;;) Line 379  for (;;)
379      If PCRE_JAVASCRIPT_COMPAT is set, a backreference to an unset bracket      If PCRE_JAVASCRIPT_COMPAT is set, a backreference to an unset bracket
380      matches an empty string (by default it causes a matching failure), so in      matches an empty string (by default it causes a matching failure), so in
381      that case we must set the minimum length to zero. */      that case we must set the minimum length to zero. */
382    
383      case OP_DNREF:     /* Duplicate named pattern back reference */      case OP_DNREF:     /* Duplicate named pattern back reference */
384      case OP_DNREFI:      case OP_DNREFI:
385      if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)      if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)
386        {        {
387        int count = GET2(cc, 1+IMM2_SIZE);        int count = GET2(cc, 1+IMM2_SIZE);
388        pcre_uchar *slot = (pcre_uchar *)re +        pcre_uchar *slot = (pcre_uchar *)re +
389          re->name_table_offset + GET2(cc, 1) * re->name_entry_size;          re->name_table_offset + GET2(cc, 1) * re->name_entry_size;
390        d = INT_MAX;        d = INT_MAX;
391        while (count-- > 0)        while (count-- > 0)
# Line 397  for (;;) Line 397  for (;;)
397            {            {
398            d = 0;            d = 0;
399            had_recurse = TRUE;            had_recurse = TRUE;
400            break;            break;
401            }            }
402          else          else
403            {            {
404            int dd = find_minlength(re, cs, startcode, options, recurse_depth);            int dd = find_minlength(re, cs, startcode, options, recurse_depth);
405            if (dd < d) d = dd;            if (dd < d) d = dd;
406            }            }
407          slot += re->name_entry_size;          slot += re->name_entry_size;
408          }          }
409        }        }
410      else d = 0;      else d = 0;
411      cc += 1 + 2*IMM2_SIZE;      cc += 1 + 2*IMM2_SIZE;
412      goto REPEAT_BACK_REFERENCE;      goto REPEAT_BACK_REFERENCE;
413    
414      case OP_REF:      /* Single back reference */      case OP_REF:      /* Single back reference */
415      case OP_REFI:      case OP_REFI:
# Line 478  for (;;) Line 478  for (;;)
478        had_recurse = TRUE;        had_recurse = TRUE;
479      else      else
480        {        {
481        branchlength += find_minlength(re, cs, startcode, options,        branchlength += find_minlength(re, cs, startcode, options,
482          recurse_depth + 1);          recurse_depth + 1);
483        }        }
484      cc += 1 + LINK_SIZE;      cc += 1 + LINK_SIZE;
# Line 1227  do Line 1227  do
1227          set_type_bits(start_bits, cbit_digit, table_limit, cd);          set_type_bits(start_bits, cbit_digit, table_limit, cd);
1228          break;          break;
1229    
1230          /* The cbit_space table has vertical tab as whitespace; we no longer          /* The cbit_space table has vertical tab as whitespace; we no longer
1231          have to play fancy tricks because Perl added VT to its whitespace at          have to play fancy tricks because Perl added VT to its whitespace at
1232          release 5.18. PCRE added it at release 8.34. */          release 5.18. PCRE added it at release 8.34. */
1233    
1234          case OP_NOT_WHITESPACE:          case OP_NOT_WHITESPACE:

Legend:
Removed from v.1403  
changed lines
  Added in v.1404

  ViewVC Help
Powered by ViewVC 1.1.5