This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Use mnemonic instead of hex constant
authorKarl Williamson <khw@cpan.org>
Thu, 20 Aug 2015 16:20:21 +0000 (10:20 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 20 Aug 2015 18:48:20 +0000 (12:48 -0600)
These constants are used in more than one place.  Use a common variable
instead of repeating the hex numbers

charclass_invlists.h
lib/unicore/mktables
regcharclass.h

index 8f14d31..f944924 100644 (file)
@@ -99537,7 +99537,7 @@ static const UV XPosixXDigit_invlist[] = { /* for EBCDIC POSIX-BC */
  * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
  * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
  * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * ad739a46951b5f46396074b0682a2cfeed24b633a742a8e1aa0e337f69ef8b1c lib/unicore/mktables
+ * 0df86fe052dfedba84605ee6a1fd17e584ef8b864b5d224acf15c8e080d1cb12 lib/unicore/mktables
  * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
  * c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
  * 8a097f8f726bb1619af2f27f149ab87e60a1602f790147e3a561358be16abd27 regen/mk_invlists.pl
index 8153936..18a8186 100644 (file)
@@ -1320,6 +1320,12 @@ my %ucd_pod;    # Holds entries that will go into the UCD section of the pod
 # unlikely that they will ever change.
 my %caseless_equivalent_to;
 
+# This is the range of characters that were in Release 1 of Unicode, and
+# removed in Release 2 (replaced with the current Hangul syllables starting at
+# U+AC00).  The range was reused starting in Release 3 for other purposes.
+my $FIRST_REMOVED_HANGUL_SYLLABLE = 0x3400;
+my $FINAL_REMOVED_HANGUL_SYLLABLE = 0x4DFF;
+
 # These constants names and values were taken from the Unicode standard,
 # version 5.1, section 3.12.  They are used in conjunction with Hangul
 # syllables.  The '_string' versions are so generated tables can retain the
@@ -3231,7 +3237,8 @@ END
         Carp::carp_extra_args(\@_) if main::DEBUG && @_;
 
         my $object = main::property_ref($property{$addr});
-        $object->add_map(0x3400, 0x4DFF,
+        $object->add_map($FIRST_REMOVED_HANGUL_SYLLABLE,
+                         $FINAL_REMOVED_HANGUL_SYLLABLE,
                          $early{$addr}[3],  # Passed-in value for these
                          Replace => $UNCONDITIONALLY);
     }
@@ -13059,7 +13066,9 @@ END
     # not being right at all.
     if ($v_version lt v2.0.0) {
         my $property = property_ref($file->property);
-        $file->insert_lines("3400..4DFF; LVT\n");
+        $file->insert_lines(sprintf("%04X..%04X; LVT\n",
+                                    $FIRST_REMOVED_HANGUL_SYLLABLE,
+                                    $FINAL_REMOVED_HANGUL_SYLLABLE));
         push @tables_that_may_be_empty, $property->table('LV')->complete_name;
         return;
     }
index f4b6298..180f59e 100644 (file)
  * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
  * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
  * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * ad739a46951b5f46396074b0682a2cfeed24b633a742a8e1aa0e337f69ef8b1c lib/unicore/mktables
+ * 0df86fe052dfedba84605ee6a1fd17e584ef8b864b5d224acf15c8e080d1cb12 lib/unicore/mktables
  * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
  * c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
  * d9c04ac46bdd81bb3e26519f2b8eb6242cb12337205add3f7cf092b0c58dccc4 regen/regcharclass.pl