- # For each of the case change mappings...
- foreach my $case ('lc', 'tc', 'uc') {
- my $full = property_ref($case);
- unless (defined $full && ! $full->is_empty) {
- Carp::my_carp_bug("Need to process UnicodeData before SpecialCasing. Only special casing will be generated.");
+ $lc = property_ref('lc');
+ $tc = property_ref('tc');
+ $uc = property_ref('uc');
+
+ # For each of the case change mappings...
+ foreach my $case_table ($lc, $tc, $uc) {
+ my $case = $case_table->name;
+ my $full = property_ref($case);
+ unless (defined $full && ! $full->is_empty) {
+ Carp::my_carp_bug("Need to process UnicodeData before SpecialCasing. Only special casing will be generated.");
+ }
+
+ # The simple version's name in each mapping merely has an 's' in
+ # front of the full one's
+ my $simple = property_ref('s' . $case);
+ $simple->initialize($full) if $simple->to_output_map();
+
+ my $simple_only = Property->new("_s$case",
+ Type => $STRING,
+ Default_Map => $CODE_POINT,
+ Perl_Extension => 1,
+ Description => "The simple mappings for $case for code points that have full mappings as well");
+ $simple_only->set_to_output_map($INTERNAL_MAP);
+ $simple_only->add_comment(join_lines( <<END
+This file is for UCD.pm so that it can construct simple mappings that would
+otherwise be lost because they are overridden by full mappings.
+END
+ ));