summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-03-11 11:50:58 -0700
committerKarl Williamson <khw@cpan.org>2017-06-01 06:33:17 -0600
commit272af0584dc7bd5ab0e8097878bd08ea604ac2e3 (patch)
treefc4fc77281e0116ba4c97977f6c45671ca3bdc93
parenta25d3b59702b551ace9e660fea69ff29d7909dd4 (diff)
downloadperl-272af0584dc7bd5ab0e8097878bd08ea604ac2e3.tar.gz
mktables: Fix up version compare
This is a feature that is used to compare 2 different Unicode versions for changes to existing code points, ignoring code points that aren't in the earlier version. It does this by removing the newly-added code points coming from the later version. One can then diff the generated directory structure against an existing one that was built under the old rules to see what changed. Prior to this commit, it assumed all version numbers were a single digit for the major number. This will no longer work for Unicode 10, about to be released. As part of the process, mktables adds blocks that didn't exist in the earlier version back to the unallocated pool. This gives better diff results. This commit does a better job of finding such blocks.
-rw-r--r--charclass_invlists.h2
-rw-r--r--lib/unicore/mktables21
-rw-r--r--regcharclass.h2
3 files changed, 20 insertions, 5 deletions
diff --git a/charclass_invlists.h b/charclass_invlists.h
index 7b5b7eae1c..4b3d6cc363 100644
--- a/charclass_invlists.h
+++ b/charclass_invlists.h
@@ -95407,7 +95407,7 @@ static const U8 WB_table[24][24] = {
* 37f6186253da9824bdb27f4ad867bfe8c25d4dc6bdb2f05585e40a034675a348 lib/unicore/extracted/DLineBreak.txt
* ef24061b5a5dc93d7e90c2e34530ec757180ee75d872cba65ffc946e52624ae8 lib/unicore/extracted/DNumType.txt
* a197371fec9a1b517058b440841f60f9378d81682084eef8db22a88cb2f96e90 lib/unicore/extracted/DNumValues.txt
- * 79a7216aceb1d291f2857085545fdda289518bc540a09bc0a15cde105d76028d lib/unicore/mktables
+ * 717985d5fe0830f5b72ca21287a7d9f15ba6a383c29fbd3c47231d5f63edb68b lib/unicore/mktables
* cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
* 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
* 9534d0cc3914fa1f5d574332c3199605c3d14f8691a0729d68d8498ac2b36280 regen/mk_invlists.pl
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index e3336f50e0..d8ccd2b2d7 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -660,7 +660,7 @@ sub stack_trace() {
# common to both releases, and you can see the changes caused just by the
# underlying release semantic changes. For versions earlier than 3.2, you
# must copy a version of DAge.txt into the directory.
-my $string_compare_versions = DEBUG && 0; # e.g., "2.1";
+my $string_compare_versions = DEBUG && ""; # e.g., "2.1";
my $compare_versions = DEBUG
&& $string_compare_versions
&& pack "C*", split /\./, $string_compare_versions;
@@ -1529,7 +1529,7 @@ sub populate_char_info ($) {
$viacode[$i] = $perl_charname->value_of($i) || "";
$age[$i] = (defined $age)
- ? (($age->value_of($i) =~ / ^ \d \. \d $ /x)
+ ? (($age->value_of($i) =~ / ^ \d+ \. \d+ $ /x)
? $age->value_of($i)
: "")
: "";
@@ -5324,6 +5324,14 @@ use parent '-norequire', '_Range_List_Base';
return $self->_add_delete('+', @_);
}
+ sub replace_map {
+ # Replace a range
+
+ my $self = shift;
+
+ return $self->_add_delete('+', @_, Replace => $UNCONDITIONALLY);
+ }
+
sub add_duplicate {
# Adds entry to a range list which can duplicate an existing entry
@@ -7733,6 +7741,7 @@ END
# Accessors for the underlying list that should fail if locked.
for my $sub (qw(
add_duplicate
+ replace_map
))
{
no strict "refs";
@@ -9367,6 +9376,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace }
range_count
ranges
range_size_1
+ replace_map
reset_each_range
set_comment
set_default_map
@@ -13898,8 +13908,10 @@ sub handle_compare_versions () {
# since the first compare version.
my $delta = Range_List->new();
foreach my $table ($age->tables) {
+ use version;
next if $table == $age->table('Unassigned');
- next if $table->name le $string_compare_versions;
+ next if version->parse($table->name)
+ le version->parse($string_compare_versions);
$delta += $table;
}
if ($delta->is_empty) {
@@ -13922,6 +13934,9 @@ sub handle_compare_versions () {
next if $this_block == $no_block
|| ! ($this_block & $Assigned)->is_empty;
$this_block->set_fate($SUPPRESSED, $after_first_version);
+ foreach my $range ($this_block->ranges) {
+ $block->replace_map($range->start, $range->end, 'No_Block')
+ }
$no_block += $this_block;
}
diff --git a/regcharclass.h b/regcharclass.h
index 273176af22..ff00207ec0 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -1897,7 +1897,7 @@
* 37f6186253da9824bdb27f4ad867bfe8c25d4dc6bdb2f05585e40a034675a348 lib/unicore/extracted/DLineBreak.txt
* ef24061b5a5dc93d7e90c2e34530ec757180ee75d872cba65ffc946e52624ae8 lib/unicore/extracted/DNumType.txt
* a197371fec9a1b517058b440841f60f9378d81682084eef8db22a88cb2f96e90 lib/unicore/extracted/DNumValues.txt
- * 79a7216aceb1d291f2857085545fdda289518bc540a09bc0a15cde105d76028d lib/unicore/mktables
+ * 717985d5fe0830f5b72ca21287a7d9f15ba6a383c29fbd3c47231d5f63edb68b lib/unicore/mktables
* cdecb300baad839a6f62791229f551a4fa33f3cbdca08e378dc976466354e778 lib/unicore/version
* 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
* c468aea5062ef84422219d74e83b6f3216f2823544b445f53ee1af71deeb2044 regen/regcharclass.pl