diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-20 01:46:03 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-20 01:46:03 +0000 |
commit | 491fd90a109f6263a896300e5709e6fd255f075f (patch) | |
tree | 596ceeddf227da61927d12e4c2ce4c324fc43bbd /lib/utf8_heavy.pl | |
parent | ee081dd1f02934d943364e5d6bd4130bf9c3e0ad (diff) | |
download | perl-491fd90a109f6263a896300e5709e6fd255f075f.tar.gz |
User-defined character properties were unintentionally
removed, noticed by Dan Kogai.
p4raw-id: //depot/perl@16012
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r-- | lib/utf8_heavy.pl | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index 70bd018f81..29d4ac2c7d 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -81,6 +81,25 @@ sub SWASHNEW { last GETFILE; } + ## + ## 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'; + + $list = &{$prop}; + last GETFILE; + } + } + } + ## ## Last attempt -- see if it's a "To" name (e.g. "ToLower") ## @@ -99,21 +118,25 @@ sub SWASHNEW { return $type; } - print "found it (file='$file')\n" if DEBUG; + if (defined $file) { + print "found it (file='$file')\n" if DEBUG; + + ## + ## If we reach here, it was due to a 'last GETFILE' above + ## (exception: user-defined properties), so we + ## have a filename, so now we load it if we haven't already. + ## If we have, return the cached results. The cache key is the + ## file to load. + ## + if ($Cache{$file} and ref($Cache{$file}) eq $class) + { + print "Returning cached '$file' for \\p{$type}\n" if DEBUG; + return $Cache{$class, $file}; + } - ## - ## If we reach here, it was due to a 'last GETFILE' above, so we - ## have a filename, so now we load it if we haven't already. - ## If we have, return the cached results. The cache key is the - ## file to load. - ## - if ($Cache{$file} and ref($Cache{$file}) eq $class) - { - print "Returning cached '$file' for \\p{$type}\n" if DEBUG; - return $Cache{$class, $file}; - } + $list = do $file; + } - $list = do $file; $ListSorted = 1; ## we know that these lists are sorted } |