# 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
# 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";
}
# 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';";
@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';
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';
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>