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

Diff of /code/trunk/pcre_xclass.c

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

revision 1403 by ph10, Sat Nov 2 18:29:05 2013 UTC revision 1404 by ph10, Tue Nov 19 15:36:57 2013 UTC
# Line 128  while ((t = *data++) != XCL_END) Line 128  while ((t = *data++) != XCL_END)
128    else  /* XCL_PROP & XCL_NOTPROP */    else  /* XCL_PROP & XCL_NOTPROP */
129      {      {
130      const ucd_record *prop = GET_UCD(c);      const ucd_record *prop = GET_UCD(c);
131      BOOL isprop = t == XCL_PROP;      BOOL isprop = t == XCL_PROP;
132    
133      switch(*data)      switch(*data)
134        {        {
# Line 163  while ((t = *data++) != XCL_END) Line 163  while ((t = *data++) != XCL_END)
163        /* Perl space used to exclude VT, but from Perl 5.18 it is included,        /* Perl space used to exclude VT, but from Perl 5.18 it is included,
164        which means that Perl space and POSIX space are now identical. PCRE        which means that Perl space and POSIX space are now identical. PCRE
165        was changed at release 8.34. */        was changed at release 8.34. */
166    
167        case PT_SPACE:    /* Perl space */        case PT_SPACE:    /* Perl space */
168        case PT_PXSPACE:  /* POSIX space */        case PT_PXSPACE:  /* POSIX space */
169        switch(c)        switch(c)
170          {          {
171          HSPACE_CASES:          HSPACE_CASES:
172          VSPACE_CASES:          VSPACE_CASES:
173          if (isprop) return !negated;          if (isprop) return !negated;
174          break;          break;
175    
176          default:          default:
177          if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == isprop)          if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z) == isprop)
178            return !negated;            return !negated;
# Line 200  while ((t = *data++) != XCL_END) Line 200  while ((t = *data++) != XCL_END)
200            return !negated;            return !negated;
201          }          }
202        break;        break;
203    
204        /* The following three properties can occur only in an XCLASS, as there        /* The following three properties can occur only in an XCLASS, as there
205        is no \p or \P coding for them. */        is no \p or \P coding for them. */
206    
207        /* Graphic character. Implement this as not Z (space or separator) and        /* Graphic character. Implement this as not Z (space or separator) and
208        not C (other), except for Cf (format) with a few exceptions. This seems        not C (other), except for Cf (format) with a few exceptions. This seems
209        to be what Perl does. The exceptional characters are:        to be what Perl does. The exceptional characters are:
210    
211        U+061C           Arabic Letter Mark        U+061C           Arabic Letter Mark
212        U+180E           Mongolian Vowel Separator        U+180E           Mongolian Vowel Separator
213        U+2066 - U+2069  Various "isolate"s        U+2066 - U+2069  Various "isolate"s
214        */        */
215    
216        case PT_PXGRAPH:        case PT_PXGRAPH:
217        if ((PRIV(ucp_gentype)[prop->chartype] != ucp_Z &&        if ((PRIV(ucp_gentype)[prop->chartype] != ucp_Z &&
218              (PRIV(ucp_gentype)[prop->chartype] != ucp_C ||              (PRIV(ucp_gentype)[prop->chartype] != ucp_C ||
219                (prop->chartype == ucp_Cf &&                (prop->chartype == ucp_Cf &&
220                  c != 0x061c && c != 0x180e && (c < 0x2066 || c > 0x2069))                  c != 0x061c && c != 0x180e && (c < 0x2066 || c > 0x2069))
221           )) == isprop)           )) == isprop)
222          return !negated;          return !negated;
223        break;        break;
224    
225        /* Printable character: same as graphic, with the addition of Zs, i.e.        /* Printable character: same as graphic, with the addition of Zs, i.e.
226        not Zl and not Zp, and U+180E. */        not Zl and not Zp, and U+180E. */
227    
228        case PT_PXPRINT:        case PT_PXPRINT:
229        if ((prop->chartype != ucp_Zl &&        if ((prop->chartype != ucp_Zl &&
230             prop->chartype != ucp_Zp &&             prop->chartype != ucp_Zp &&
231              (PRIV(ucp_gentype)[prop->chartype] != ucp_C ||              (PRIV(ucp_gentype)[prop->chartype] != ucp_C ||
232                (prop->chartype == ucp_Cf &&                (prop->chartype == ucp_Cf &&
233                  c != 0x061c && (c < 0x2066 || c > 0x2069))                  c != 0x061c && (c < 0x2066 || c > 0x2069))
234           )) == isprop)           )) == isprop)
235          return !negated;          return !negated;
236        break;        break;
237    
238        /* Punctuation: all Unicode punctuation, plus ASCII characters that        /* Punctuation: all Unicode punctuation, plus ASCII characters that
239        Unicode treats as symbols rather than punctuation, for Perl        Unicode treats as symbols rather than punctuation, for Perl
240        compatibility (these are $+<=>^`|~). */        compatibility (these are $+<=>^`|~). */
241    
# Line 243  while ((t = *data++) != XCL_END) Line 243  while ((t = *data++) != XCL_END)
243        if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||        if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||
244              (c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)              (c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
245          return !negated;          return !negated;
246        break;        break;
247    
248        /* This should never occur, but compilers may mutter if there is no        /* This should never occur, but compilers may mutter if there is no
249        default. */        default. */

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

  ViewVC Help
Powered by ViewVC 1.1.5