diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-05-11 21:08:36 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-05-19 10:31:20 -0600 |
commit | ec2f012870ad64a16921f53f65a691592067bbce (patch) | |
tree | 5e7ba3b72d98abfc609720b92f9980295d73d23f /lib | |
parent | 83fe8199d6a7b634f6e1ad1413c2d33afffa8ba2 (diff) | |
download | perl-ec2f012870ad64a16921f53f65a691592067bbce.tar.gz |
mktables: Add info giving specials hash name
mktables creates %utf8::SwashInfo in each table it generates, giving
some info about the table. Add an entry to this for tables that have
a hash of special mappings, giving the name of that hash.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unicore/mktables | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables index fc287a918a..648c49aff8 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -5960,7 +5960,9 @@ END # Here we assume we were called after have gone through the whole # file. If we actually generated anything for each map type, add its # respective header and trailer + my $specials_name = ""; if (@multi_code_point_maps) { + $specials_name = "utf8::ToSpec$name"; $pre_body .= <<END; # Some code points require special handling because their mappings are each to @@ -5970,7 +5972,7 @@ END # Each key is the string of N bytes that together make up the UTF-8 encoding # for the code point. (i.e. the same as looking at the code point's UTF-8 # under "use bytes"). Each value is the UTF-8 of the translation, for speed. -%utf8::ToSpec$name = ( +\%$specials_name = ( END $pre_body .= join("\n", @multi_code_point_maps) . "\n);\n"; } @@ -6194,6 +6196,11 @@ END # map to. \$utf8::SwashInfo{'To$name'}{'format'} = '$format'; # $map_table_formats{$format} END + if ($specials_name) { + $return .= <<END; +\$utf8::SwashInfo{'To$name'}{'specials_name'} = '$specials_name'; # Name of hash of special mappings +END + } my $default_map = $default_map{$addr}; $return .= "\$utf8::SwashInfo{'To$name'}{'missing'} = '$default_map';"; @@ -13283,8 +13290,8 @@ are: @map_tables_actually_output -Each of the files in this directory defines two hash entries to help reading -programs decipher it. One of them looks like this: +Each of the files in this directory defines several hash entries to help +reading programs decipher it. One of them looks like this: \$utf8::SwashInfo{'ToNAME'}{'format'} = 's'; @@ -13299,7 +13306,7 @@ This format applies only to the entries in the main body of the table. Entries defined in hashes or ones that are missing from the list can have a different format. -The value that the missing entries have is given by the other SwashInfo hash +The value that the missing entries have is given by another SwashInfo hash entry line; it looks like this: \$utf8::SwashInfo{'ToNAME'}{'missing'} = 'NaN'; @@ -13311,6 +13318,11 @@ any missing code point is the code point itself. This happens, for example, in the file for Uppercase_Mapping (To/Upper.pl), in which code points like the character 'A', are missing because the uppercase of 'A' is itself. +Finally, if the file contains a hash for special case entries, its name is +specified by an entry that looks like this: + + \$utf8::SwashInfo{'ToNAME'}{'specials_name'} = 'utf8::ToSpecNAME'; + =head1 SEE ALSO L<$unicode_reference_url> |