summaryrefslogtreecommitdiff
path: root/lib/utf8_heavy.pl
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-11-19 14:49:20 -0700
committerKarl Williamson <public@khwilliamson.com>2012-01-13 09:58:33 -0700
commit20b1a8918cf079bce8353cc51059b0ff48ed4ad6 (patch)
tree6333e3174199041656722de73b0fb550d788472d /lib/utf8_heavy.pl
parent25df5e40da0b4108bfd2594a91de85054a1fa867 (diff)
downloadperl-20b1a8918cf079bce8353cc51059b0ff48ed4ad6.tar.gz
utf8_heavy: Allow to be called from regcomp.c
Future commits will cause regcomp.c to try to compile user-defined properties. The caller stack is different for this, and there may be a package name as well that differs from the existing scheme. This commit allows for this.
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r--lib/utf8_heavy.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl
index e63999fd44..6f639f04ec 100644
--- a/lib/utf8_heavy.pl
+++ b/lib/utf8_heavy.pl
@@ -120,7 +120,7 @@ sub _loose_name ($) {
# regcomp.c surrounds the property name with '__" and '_i' if this
# is to be caseless matching.
- my $caseless = $type =~ s/^__(.*)_i$/$1/;
+ my $caseless = $type =~ s/^(.*)__(.*)_i$/$1$2/;
print STDERR __LINE__, ": type=$type, caseless=$caseless\n" if DEBUG;
@@ -131,7 +131,10 @@ sub _loose_name ($) {
## package if no package given
##
- my $caller1 = $type =~ s/(.+)::// ? $1 : caller(1);
+
+ my $caller0 = caller(0);
+ my $caller1 = $type =~ s/(.+)::// ? $1 : $caller0 eq 'main' ?
+ 'main' : caller(1);
if (defined $caller1 && $type =~ /^I[ns]\w+$/) {
my $prop = "${caller1}::$type";