| 6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 7 |
|
|
| 8 |
Written by Philip Hazel |
Written by Philip Hazel |
| 9 |
Copyright (c) 1997-2007 University of Cambridge |
Copyright (c) 1997-2008 University of Cambridge |
| 10 |
|
|
| 11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 44 |
|
|
| 45 |
|
|
| 46 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| 47 |
#include <config.h> |
#include "config.h" |
| 48 |
#endif |
#endif |
| 49 |
|
|
| 50 |
#include "pcre_internal.h" |
#include "pcre_internal.h" |
| 104 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 105 |
else /* XCL_PROP & XCL_NOTPROP */ |
else /* XCL_PROP & XCL_NOTPROP */ |
| 106 |
{ |
{ |
| 107 |
int chartype, script; |
const ucd_record * prop = GET_UCD(c); |
|
int category = _pcre_ucp_findprop(c, &chartype, &script); |
|
| 108 |
|
|
| 109 |
switch(*data) |
switch(*data) |
| 110 |
{ |
{ |
| 113 |
break; |
break; |
| 114 |
|
|
| 115 |
case PT_LAMP: |
case PT_LAMP: |
| 116 |
if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == |
if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == |
| 117 |
(t == XCL_PROP)) return !negated; |
(t == XCL_PROP)) return !negated; |
| 118 |
break; |
break; |
| 119 |
|
|
| 120 |
case PT_GC: |
case PT_GC: |
| 121 |
if ((data[1] == category) == (t == XCL_PROP)) return !negated; |
if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP)) return !negated; |
| 122 |
break; |
break; |
| 123 |
|
|
| 124 |
case PT_PC: |
case PT_PC: |
| 125 |
if ((data[1] == chartype) == (t == XCL_PROP)) return !negated; |
if ((data[1] == prop->chartype) == (t == XCL_PROP)) return !negated; |
| 126 |
break; |
break; |
| 127 |
|
|
| 128 |
case PT_SC: |
case PT_SC: |
| 129 |
if ((data[1] == script) == (t == XCL_PROP)) return !negated; |
if ((data[1] == prop->script) == (t == XCL_PROP)) return !negated; |
| 130 |
break; |
break; |
| 131 |
|
|
| 132 |
/* This should never occur, but compilers may mutter if there is no |
/* This should never occur, but compilers may mutter if there is no |