summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-12-23 13:49:02 -0700
committerKarl Williamson <public@khwilliamson.com>2012-12-23 14:05:28 -0700
commiteba68aa09a0b159ee4eef3cee1bd58ee95fdb81a (patch)
tree4a3fd382c4ba851804dfbe58044b6d96ed20ed28 /ext
parent31a09021a5558064a4417036c917712e2435edf7 (diff)
downloadperl-eba68aa09a0b159ee4eef3cee1bd58ee95fdb81a.tar.gz
handy.h: Add full complement of isIDCONT() macros
This also changes isIDCONT_utf8() to use the Perl definition, which excludes any \W characters (the Unicode definition includes a few of these). Tests are also added. These macros remain undocumented for now.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/APItest.pm2
-rw-r--r--ext/XS-APItest/APItest.xs49
-rw-r--r--ext/XS-APItest/t/handy.t7
3 files changed, 54 insertions, 4 deletions
diff --git a/ext/XS-APItest/APItest.pm b/ext/XS-APItest/APItest.pm
index 831b6f3045..3d7449b63d 100644
--- a/ext/XS-APItest/APItest.pm
+++ b/ext/XS-APItest/APItest.pm
@@ -5,7 +5,7 @@ use strict;
use warnings;
use Carp;
-our $VERSION = '0.49';
+our $VERSION = '0.50';
require XSLoader;
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 2155bc9c93..b23232c7a0 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -3998,6 +3998,55 @@ test_isIDFIRST_LC_utf8(unsigned char * p)
RETVAL
bool
+test_isIDCONT_uni(UV ord)
+ CODE:
+ RETVAL = isIDCONT_uni(ord);
+ OUTPUT:
+ RETVAL
+
+bool
+test_isIDCONT_LC_uvchr(UV ord)
+ CODE:
+ RETVAL = isIDCONT_LC_uvchr(ord);
+ OUTPUT:
+ RETVAL
+
+bool
+test_isIDCONT_A(UV ord)
+ CODE:
+ RETVAL = isIDCONT_A(ord);
+ OUTPUT:
+ RETVAL
+
+bool
+test_isIDCONT_L1(UV ord)
+ CODE:
+ RETVAL = isIDCONT_L1(ord);
+ OUTPUT:
+ RETVAL
+
+bool
+test_isIDCONT_LC(UV ord)
+ CODE:
+ RETVAL = isIDCONT_LC(ord);
+ OUTPUT:
+ RETVAL
+
+bool
+test_isIDCONT_utf8(unsigned char * p)
+ CODE:
+ RETVAL = isIDCONT_utf8( p);
+ OUTPUT:
+ RETVAL
+
+bool
+test_isIDCONT_LC_utf8(unsigned char * p)
+ CODE:
+ RETVAL = isIDCONT_LC_utf8( p);
+ OUTPUT:
+ RETVAL
+
+bool
test_isSPACE_uni(UV ord)
CODE:
RETVAL = isSPACE_uni(ord);
diff --git a/ext/XS-APItest/t/handy.t b/ext/XS-APItest/t/handy.t
index ffa2f174fc..0730c109e0 100644
--- a/ext/XS-APItest/t/handy.t
+++ b/ext/XS-APItest/t/handy.t
@@ -38,6 +38,7 @@ my %properties = (
digit => 'Digit',
graph => 'Graph',
idfirst => '_Perl_IDStart',
+ idcont => '_Perl_IDCont',
lower => 'Lower',
print => 'Print',
psxspc => 'XPosixSpace',
@@ -73,9 +74,9 @@ foreach my $name (sort keys %properties) {
last if $above_latins > 5;
}
- # This makes sure we are using the Perl definition of idfirst, and not the
- # Unicode. There are a few differences.
- push @code_points, ord "\N{ESTIMATED SYMBOL}" if $name eq 'idfirst';
+ # This makes sure we are using the Perl definition of idfirst and idcont,
+ # and not the Unicode. There are a few differences.
+ push @code_points, ord "\N{ESTIMATED SYMBOL}" if $name =~ /^id(first|cont)/;
# And finally one non-Unicode code point.
push @code_points, 0x110000; # Above Unicode, no prop should match