local $^D = 0 if $^D;
$class = "" unless defined $class;
- print STDERR __LINE__, ": class=$class, type=$type, list=$list, minbits=$minbits, none=$none\n" if DEBUG;
+ print STDERR __LINE__, ": class=$class, type=$type, list=",
+ (defined $list) ? $list : ':undef:',
+ ", minbits=$minbits, none=$none\n" if DEBUG;
##
## Get the list of codepoints for the type.
$type =~ s/^\s+//;
$type =~ s/\s+$//;
- print STDERR __LINE__, ": type = $type\n" if DEBUG;
+ # regcomp.c surrounds the property name with '__" and '_i' if this
+ # is to be caseless matching.
+ my $caseless = $type =~ s/^__(.*)_i$/$1/;
+
+ print STDERR __LINE__, ": type=$type, caseless=$caseless\n" if DEBUG;
GETFILE:
{
my $caller1 = $type =~ s/(.+)::// ? $1 : caller(1);
- if (defined $caller1 && $type =~ /^(?:\w+)$/) {
+ if (defined $caller1 && $type =~ /^I[ns]\w+$/) {
my $prop = "${caller1}::$type";
if (exists &{$prop}) {
no strict 'refs';
- $list = &{$prop};
+ $list = &{$prop}($caseless);
last GETFILE;
}
}
}
BEGIN { delete $utf8::{miniperl} }
- # Everything is caseless matching
+ # All property names are matched caselessly
my $property_and_table = lc $type;
print STDERR __LINE__, ": $property_and_table\n" if DEBUG;
if ($utf8::why_deprecated{$file}) {
warnings::warnif('deprecated', "Use of '$type' in \\p{} or \\P{} is deprecated because: $utf8::why_deprecated{$file};");
}
+
+ if ($caseless
+ && exists $utf8::caseless_equivalent{$property_and_table})
+ {
+ $file = $utf8::caseless_equivalent{$property_and_table};
+ }
$file= "$unicore_dir/lib/$file.pl";
last GETFILE;
}
my $extras;
my $bits = $minbits;
- my $ORIG = $list;
if ($list) {
my @tmp = split(/^/m, $list);
my %seen;