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

Diff of /code/trunk/pcre_compile.c

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

revision 1363 by ph10, Tue Oct 1 16:54:40 2013 UTC revision 1364 by ph10, Sat Oct 5 15:45:11 2013 UTC
# Line 2650  switch(ptype) Line 2650  switch(ptype)
2650    return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||    return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
2651            PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated;            PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated;
2652    
2653      /* Perl space used to exclude VT, but from Perl 5.18 it is included, which
2654      means that Perl space and POSIX space are now identical. PCRE was changed
2655      at release 8.34. */
2656    
2657    case PT_SPACE:    /* Perl space */    case PT_SPACE:    /* Perl space */
   return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||  
           c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)  
           == negated;  
   
2658    case PT_PXSPACE:  /* POSIX space */    case PT_PXSPACE:  /* POSIX space */
2659    return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||    return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
2660            c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||            c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
# Line 4627  for (;; ptr++) Line 4627  for (;; ptr++)
4627              for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];              for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_word];
4628              continue;              continue;
4629    
4630              /* Perl 5.004 onwards omits VT from \s, but we must preserve it              /* Perl 5.004 onwards omitted VT from \s, but restored it at Perl
4631              if it was previously set by something earlier in the character              5.18. Before PCRE 8.34, we had to preserve the VT bit if it was
4632              class. Luckily, the value of CHAR_VT is 0x0b in both ASCII and              previously set by something earlier in the character class.
4633              EBCDIC, so we lazily just adjust the appropriate bit. */              Luckily, the value of CHAR_VT is 0x0b in both ASCII and EBCDIC, so
4634                we could just adjust the appropriate bit. From PCRE 8.34 we no
4635                longer treat \s and \S specially. */
4636    
4637              case ESC_s:              case ESC_s:
4638              classbits[0] |= cbits[cbit_space];              for (c = 0; c < 32; c++) classbits[c] |= cbits[c+cbit_space];
             classbits[1] |= cbits[cbit_space+1] & ~0x08;  
             for (c = 2; c < 32; c++) classbits[c] |= cbits[c+cbit_space];  
4639              continue;              continue;
4640    
4641              case ESC_S:              case ESC_S:
4642              should_flip_negation = TRUE;              should_flip_negation = TRUE;
4643              for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];              for (c = 0; c < 32; c++) classbits[c] |= ~cbits[c+cbit_space];
             classbits[1] |= 0x08;    /* Perl 5.004 onwards omits VT from \s */  
4644              continue;              continue;
4645    
4646              /* The rest apply in both UCP and non-UCP cases. */              /* The rest apply in both UCP and non-UCP cases. */

Legend:
Removed from v.1363  
changed lines
  Added in v.1364

  ViewVC Help
Powered by ViewVC 1.1.5