summaryrefslogtreecommitdiff
path: root/lib/utf8_heavy.pl
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-05-14 10:10:21 -0600
committerKarl Williamson <public@khwilliamson.com>2011-05-19 10:31:20 -0600
commit64870e056a120beee73d9952c055e61d91973578 (patch)
tree0998648bc6daf66fd073e86c5eebe852f47e6e47 /lib/utf8_heavy.pl
parentfbe6f3cfe96af50ec0bf4a6c1748bf45042d07d5 (diff)
downloadperl-64870e056a120beee73d9952c055e61d91973578.tar.gz
utf8_heavy: Return pointer to special treatment hash.
Many of the mapping tables that utf8_heavy.pl deals with have maps that don't fit into the general scheme of things, and a hash is generated for those. This patch causes utf8_heavy to add an entry to the object it generates containing a reference to this hash. Prior to this, the name of the hash had to be known to the users of the table.
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r--lib/utf8_heavy.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl
index b744b3bfa1..13caa39800 100644
--- a/lib/utf8_heavy.pl
+++ b/lib/utf8_heavy.pl
@@ -74,6 +74,8 @@ sub croak { require Carp; Carp::croak(@_) }
# Upon success, a new (or cached) blessed object is returned with
# keys TYPE, BITS, EXTRAS, LIST, and NONE with values having the
# same meanings as the input parameters.
+ # And if there is a special-treatment hash in the file, a reference
+ # to it is returned in the entry with key SPECIALS
my $file; ## file to load data from, and also part of the %Cache key.
my $ListSorted = 0;
@@ -540,6 +542,15 @@ sub croak { require Carp; Carp::croak(@_) }
if ($file) {
$Cache{$class, $file} = $SWASH;
+ if ($type
+ && exists $utf8::SwashInfo{$type}
+ && exists $utf8::SwashInfo{$type}{'specials_name'})
+ {
+ my $specials_name = $utf8::SwashInfo{$type}{'specials_name'};
+ no strict "refs";
+ print STDERR "\nspecials_name => $SWASH->{'SPECIALS'}\n" if DEBUG;
+ $SWASH->{'SPECIALS'} = \%$specials_name;
+ }
}
pop @recursed if @recursed && $type;