summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib/pcre_xclass.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2010-08-14 14:37:13 +0000
committerIlia Alshanetsky <iliaa@php.net>2010-08-14 14:37:13 +0000
commitc5602787fca62e64a63b99e7ae3f310f72e2cac9 (patch)
treec03f412a77986b5f66e76ca2a1155ba7efc511f0 /ext/pcre/pcrelib/pcre_xclass.c
parentc1019643253d2d65d813358e1bc37ecf5dd365ed (diff)
downloadphp-git-c5602787fca62e64a63b99e7ae3f310f72e2cac9.tar.gz
MFH: Upgraded bundled PCRE to version 8.10.
Diffstat (limited to 'ext/pcre/pcrelib/pcre_xclass.c')
-rw-r--r--ext/pcre/pcrelib/pcre_xclass.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/ext/pcre/pcrelib/pcre_xclass.c b/ext/pcre/pcrelib/pcre_xclass.c
index 3fc3ba368a..98841c5560 100644
--- a/ext/pcre/pcrelib/pcre_xclass.c
+++ b/ext/pcre/pcrelib/pcre_xclass.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2009 University of Cambridge
+ Copyright (c) 1997-2010 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -110,12 +110,13 @@ while ((t = *data++) != XCL_END)
break;
case PT_LAMP:
- if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) ==
- (t == XCL_PROP)) return !negated;
+ if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
+ prop->chartype == ucp_Lt) == (t == XCL_PROP)) return !negated;
break;
case PT_GC:
- if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP)) return !negated;
+ if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP))
+ return !negated;
break;
case PT_PC:
@@ -126,6 +127,33 @@ while ((t = *data++) != XCL_END)
if ((data[1] == prop->script) == (t == XCL_PROP)) return !negated;
break;
+ case PT_ALNUM:
+ if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
+ _pcre_ucp_gentype[prop->chartype] == ucp_N) == (t == XCL_PROP))
+ return !negated;
+ break;
+
+ case PT_SPACE: /* Perl space */
+ if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)
+ == (t == XCL_PROP))
+ return !negated;
+ break;
+
+ case PT_PXSPACE: /* POSIX space */
+ if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
+ c == CHAR_FF || c == CHAR_CR) == (t == XCL_PROP))
+ return !negated;
+ break;
+
+ case PT_WORD:
+ if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
+ _pcre_ucp_gentype[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE)
+ == (t == XCL_PROP))
+ return !negated;
+ break;
+
/* This should never occur, but compilers may mutter if there is no
default. */