summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-07-01 10:35:37 -0600
committerKarl Williamson <public@khwilliamson.com>2011-07-03 14:05:49 -0600
commit7fc6cb55f6c8953c7d246c553456d1dab5aec774 (patch)
tree219f811d65afdc7326bf9709a83c733684604939 /lib
parenta92d5c2e4647ac12b60c5732210445ac4c458ad3 (diff)
downloadperl-7fc6cb55f6c8953c7d246c553456d1dab5aec774.tar.gz
mktables: Empty tables are complements of \p{Any}
Previously one empty table was written, and all the rest were aliased to it, but now that one table isn't written, all are aliased to 'Any'.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicore/mktables17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 02623d1c68..749952f76f 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -1288,6 +1288,7 @@ my $perl;
my $block;
my $perl_charname;
my $print;
+my $Any;
# Are there conflicting names because of beginning with 'In_', or 'Is_'
my $has_In_conflicts = 0;
@@ -11370,7 +11371,7 @@ sub compile_perl() {
# 'Any' is all code points. As an error check, instead of just setting it
# to be that, construct it to be the union of all the major categories
- my $Any = $perl->add_match_table('Any',
+ $Any = $perl->add_match_table('Any',
Description => "[\\x{0000}-\\x{$LAST_UNICODE_CODEPOINT_STRING}]",
Matches_All => 1);
@@ -13525,9 +13526,16 @@ sub write_all_tables() {
# (sort so that if there is an immutable file name, it has precedence, so
# some other property can't come in and take over its file name. If b's
# file name is defined, will return 1, meaning to take it first; don't
- # care if both defined, as they had better be different anyway)
+ # care if both defined, as they had better be different anyway. And the
+ # property named 'Perl' needs to be first (it doesn't have any immutable
+ # file name) because empty properties are defined in terms of it's table
+ # named 'Any'.)
PROPERTY:
- foreach my $property (sort { defined $b->file } property_ref('*')) {
+ foreach my $property (sort { return -1 if $a == $perl;
+ return 1 if $b == $perl;
+ return defined $b->file
+ } property_ref('*'))
+ {
my $type = $property->type;
# And for each table for that property, starting with the mapping
@@ -13648,6 +13656,9 @@ sub write_all_tables() {
{
push @unhandled_properties, "$table";
}
+
+ # An empty table is just the complement of everything.
+ $table->set_complement($Any) if $table != $property;
}
elsif ($expected_empty) {
my $because = "";