print STDERR "$1 => $2\n" if DEBUG;
if ($char =~ /[-+!]/) {
my ($c,$t) = split(/::/, $name, 2); # bogus use of ::, really
- my $subobj = $c->SWASHNEW($t, "", 0, 0, 0);
+ my $subobj;
+ if ($c eq 'utf8') {
+ $subobj = $c->SWASHNEW($t, "", 0, 0, 0);
+ }
+ elsif ($c =~ /^([0-9a-fA-F]+)/) {
+ $subobj = utf8->SWASHNEW("", $c, 0, 0, 0);
+ }
return $subobj unless ref $subobj;
push @extras, $name => $subobj;
$bits = $subobj->{BITS} if $bits < $subobj->{BITS};
=item *
Two hexadecimal numbers separated by a tabulator denoting a range
-of Unicode codepoints.
+of Unicode codepoints to include.
=item *
-An existing character property prefixed by "+utf8::" to include
-all the characters in that property.
+Something to include, prefixed by "+": either an built-in character
+property (prefixed by "utf8::"), for all the characters in that
+property; or two hexadecimal codepoints for a range; or a single
+hexadecimal codepoint.
=item *
-An existing character property prefixed by "-utf8::" to exclude
-all the characters in that property.
+Something to exclude, prefixed by "-": either an existing character
+property (prefixed by "utf8::"), for all the characters in that
+property; or two hexadecimal codepoints for a range; or a single
+hexadecimal codepoint.
=item *
-An existing character property prefixed by "!utf8::" to include
-all except the characters in that property.
+Something to negate, prefixed "!": either an existing character
+property (prefixed by "utf8::") for all the characters except the
+characters in the property; or two hexadecimal codepoints for a range;
+or a single hexadecimal codepoint.
=back
$| = 1;
-print "1..908\n";
+print "1..910\n";
BEGIN {
chdir 't' if -d 't';
print "\x{3040}" =~ /\p{InNotKana}/ ? "ok $test\n" : "not ok $test\n"; $test++;
print "\x{3041}" =~ /\P{InNotKana}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+sub InConsonant { # Not EBCDIC-aware.
+ return <<EOF;
+0061 007f
+-0061
+-0065
+-0069
+-006f
+-0075
+EOF
+}
+
+print "d" =~ /\p{InConsonant}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+print "e" =~ /\P{InConsonant}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+