## ranges.
##
## To make the parsing of $type clear, this code takes the a rather
- ## unorthadox approach of last'ing out of the block once we have the
+ ## unorthodox approach of last'ing out of the block once we have the
## info we need. Were this to be a subroutine, the 'last' would just
## be a 'return'.
##
##
## 'Block=' is replaced by 'In'.
##
- $type =~ s/^Is(?:\s+|[-_])?//i
+ my $wasIs;
+
+ ($wasIs = $type =~ s/^Is(?:\s+|[-_])?//i)
or
$type =~ s/^Category\s*=\s*//i
or
## It could be a user-defined property.
##
- if ($type =~ /^I[ns](\w+)$/) {
- my @caller = caller(1);
-
- if (defined $caller[0]) {
- my $prop = $caller[0] . "::" . $type;
-
- if (exists &{$prop}) {
- no strict 'refs';
+ my $caller = caller(1);
- $list = &{$prop};
- last GETFILE;
- }
- }
- }
+ if (defined $caller && $type =~ /^(?:\w+)$/) {
+ my $prop = $caller . "::" . ( $wasIs ? "Is" : "" ) . $type;
+ if (exists &{$prop}) {
+ no strict 'refs';
+
+ $list = &{$prop};
+ last GETFILE;
+ }
+ }
##
## Last attempt -- see if it's a "To" name (e.g. "ToLower")
$| = 1;
-print "1..928\n";
+print "1..932\n";
BEGIN {
chdir 't' if -d 't';
"ok $test - postponed interpolation of qr// preserves utf8 # TODO\n");
++$test;
-# last test 928
+print "# more user-defined character properties\n";
+
+sub IsSyriac1 {
+ return <<'END';
+0712 072C
+0730 074A
+END
+}
+
+print "\x{0712}" =~ /\p{IsSyriac1}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+print "\x{072F}" =~ /\P{IsSyriac1}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+
+sub Syriac1 {
+ return <<'END';
+0712 072C
+0730 074A
+END
+}
+
+print "\x{0712}" =~ /\p{Syriac1}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+print "\x{072F}" =~ /\P{Syriac1}/ ? "ok $test\n" : "not ok $test\n"; $test++;
+
+# last test 932