/[pcre]/code/branches/pcre16/pcre_compile.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_compile.c

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

revision 767 by zherczeg, Sat Nov 26 12:48:56 2011 UTC revision 769 by zherczeg, Sun Nov 27 17:40:33 2011 UTC
# Line 1615  for (;;) Line 1615  for (;;)
1615      case OP_ONCE:      case OP_ONCE:
1616      case OP_ONCE_NC:      case OP_ONCE_NC:
1617      case OP_COND:      case OP_COND:
1618      d = find_fixedlength(cc + ((op == OP_CBRA)? 2:0), utf8, atend, cd);      d = find_fixedlength(cc + ((op == OP_CBRA)? IMM2_SIZE : 0), utf8, atend, cd);
1619      if (d < 0) return d;      if (d < 0) return d;
1620      branchlength += d;      branchlength += d;
1621      do cc += GET(cc, 1); while (*cc == OP_ALT);      do cc += GET(cc, 1); while (*cc == OP_ALT);
# Line 1721  for (;;) Line 1721  for (;;)
1721      case OP_NOTEXACT:      case OP_NOTEXACT:
1722      case OP_NOTEXACTI:      case OP_NOTEXACTI:
1723      branchlength += GET2(cc,1);      branchlength += GET2(cc,1);
1724      cc += 4;      cc += 2 + IMM2_SIZE;
1725  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1726      if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];      if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
1727  #endif  #endif
# Line 1729  for (;;) Line 1729  for (;;)
1729    
1730      case OP_TYPEEXACT:      case OP_TYPEEXACT:
1731      branchlength += GET2(cc,1);      branchlength += GET2(cc,1);
1732      if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2;      if (cc[1 + IMM2_SIZE] == OP_PROP || cc[1 + IMM2_SIZE] == OP_NOTPROP) cc += 2;
1733      cc += 4;      cc += 1 + IMM2_SIZE + 1;
1734      break;      break;
1735    
1736      /* Handle single-char matchers */      /* Handle single-char matchers */
# Line 1786  for (;;) Line 1786  for (;;)
1786    
1787        case OP_CRRANGE:        case OP_CRRANGE:
1788        case OP_CRMINRANGE:        case OP_CRMINRANGE:
1789        if (GET2(cc,1) != GET2(cc,3)) return -1;        if (GET2(cc,1) != GET2(cc,1+IMM2_SIZE)) return -1;
1790        branchlength += GET2(cc,1);        branchlength += GET2(cc,1);
1791        cc += 5;        cc += 1 + 2 * IMM2_SIZE;
1792        break;        break;
1793    
1794        default:        default:
# Line 1967  for (;;) Line 1967  for (;;)
1967        case OP_TYPEMINUPTO:        case OP_TYPEMINUPTO:
1968        case OP_TYPEEXACT:        case OP_TYPEEXACT:
1969        case OP_TYPEPOSUPTO:        case OP_TYPEPOSUPTO:
1970        if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2;        if (code[1 + IMM2_SIZE] == OP_PROP
1971            || code[1 + IMM2_SIZE] == OP_NOTPROP) code += 2;
1972        break;        break;
1973    
1974        case OP_MARK:        case OP_MARK:
# Line 2086  for (;;) Line 2087  for (;;)
2087        case OP_TYPEUPTO:        case OP_TYPEUPTO:
2088        case OP_TYPEMINUPTO:        case OP_TYPEMINUPTO:
2089        case OP_TYPEEXACT:        case OP_TYPEEXACT:
2090        if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2;        if (code[1 + IMM2_SIZE] == OP_PROP
2091            || code[1 + IMM2_SIZE] == OP_NOTPROP) code += 2;
2092        break;        break;
2093    
2094        case OP_MARK:        case OP_MARK:
# Line 2383  for (code = first_significant_code(code Line 2385  for (code = first_significant_code(code
2385      case OP_TYPEUPTO:      case OP_TYPEUPTO:
2386      case OP_TYPEMINUPTO:      case OP_TYPEMINUPTO:
2387      case OP_TYPEPOSUPTO:      case OP_TYPEPOSUPTO:
2388      if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2;      if (code[1 + IMM2_SIZE] == OP_PROP
2389          || code[1 + IMM2_SIZE] == OP_NOTPROP) code += 2;
2390      break;      break;
2391    
2392      /* End of branch */      /* End of branch */
# Line 2420  for (code = first_significant_code(code Line 2423  for (code = first_significant_code(code
2423      case OP_MINUPTOI:      case OP_MINUPTOI:
2424      case OP_POSUPTO:      case OP_POSUPTO:
2425      case OP_POSUPTOI:      case OP_POSUPTOI:
2426      if (utf8 && code[3] >= 0xc0) code += PRIV(utf8_table4)[code[3] & 0x3f];      if (utf8 && code[1 + IMM2_SIZE] >= 0xc0) code += PRIV(utf8_table4)[code[1 + IMM2_SIZE] & 0x3f];
2427      break;      break;
2428  #endif  #endif
2429    
# Line 5181  for (;; ptr++) Line 5184  for (;; ptr++)
5184    
5185        if (*tempcode == OP_TYPEEXACT)        if (*tempcode == OP_TYPEEXACT)
5186          tempcode += PRIV(OP_lengths)[*tempcode] +          tempcode += PRIV(OP_lengths)[*tempcode] +
5187            ((tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP)? 2 : 0);            ((tempcode[1 + IMM2_SIZE] == OP_PROP
5188              || tempcode[1 + IMM2_SIZE] == OP_NOTPROP)? 2 : 0);
5189    
5190        else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT)        else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT)
5191          {          {
# Line 5420  for (;; ptr++) Line 5424  for (;; ptr++)
5424            break;            break;
5425    
5426          /* Most other conditions use OP_CREF (a couple change to OP_RREF          /* Most other conditions use OP_CREF (a couple change to OP_RREF
5427          below), and all need to skip 3 bytes at the start of the group. */          below), and all need to skip 1+IMM2_SIZE bytes at the start of the group. */
5428    
5429          code[1+LINK_SIZE] = OP_CREF;          code[1+LINK_SIZE] = OP_CREF;
5430          skipbytes = 3;          skipbytes = 1+IMM2_SIZE;
5431          refsign = -1;          refsign = -1;
5432    
5433          /* Check for a test for recursion in a named group. */          /* Check for a test for recursion in a named group. */
# Line 6164  for (;; ptr++) Line 6168  for (;; ptr++)
6168        NUMBERED_GROUP:        NUMBERED_GROUP:
6169        cd->bracount += 1;        cd->bracount += 1;
6170        PUT2(code, 1+LINK_SIZE, cd->bracount);        PUT2(code, 1+LINK_SIZE, cd->bracount);
6171        skipbytes = 2;        skipbytes = IMM2_SIZE;
6172        }        }
6173    
6174      /* Process nested bracketed regex. Assertions used not to be repeatable,      /* Process nested bracketed regex. Assertions used not to be repeatable,
# Line 7165  register int c = -1; Line 7169  register int c = -1;
7169  do {  do {
7170     int d;     int d;
7171     int xl = (*code == OP_CBRA || *code == OP_SCBRA ||     int xl = (*code == OP_CBRA || *code == OP_SCBRA ||
7172               *code == OP_CBRAPOS || *code == OP_SCBRAPOS)? 2:0;               *code == OP_CBRAPOS || *code == OP_SCBRAPOS)? IMM2_SIZE:0;
7173     const pcre_uchar *scode = first_significant_code(code + 1+LINK_SIZE + xl,     const pcre_uchar *scode = first_significant_code(code + 1+LINK_SIZE + xl,
7174       TRUE);       TRUE);
7175     register int op = *scode;     register int op = *scode;
# Line 7191  do { Line 7195  do {
7195       break;       break;
7196    
7197       case OP_EXACT:       case OP_EXACT:
7198       scode += 2;       scode += IMM2_SIZE;
7199       /* Fall through */       /* Fall through */
7200    
7201       case OP_CHAR:       case OP_CHAR:
# Line 7204  do { Line 7208  do {
7208       break;       break;
7209    
7210       case OP_EXACTI:       case OP_EXACTI:
7211       scode += 2;       scode += IMM2_SIZE;
7212       /* Fall through */       /* Fall through */
7213    
7214       case OP_CHARI:       case OP_CHARI:

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

  ViewVC Help
Powered by ViewVC 1.1.5