summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-02-24 13:35:01 -0700
committerKarl Williamson <khw@cpan.org>2020-03-11 09:00:04 -0600
commit5f270787832458b6f6e80d68a820cd42a983fbb2 (patch)
tree0a49552fe26741bdd3cc78a46f47035af8faae2d /lib
parent21ef35ea8a86bd672860a866b2cdeeeb842e0de1 (diff)
downloadperl-5f270787832458b6f6e80d68a820cd42a983fbb2.tar.gz
mktables: Calculate legal chars in algorithmic names
Many ideographic character names are of the form 'prefix-code_point'. For these, we know that the legal names are just the ones in the prefix, the dash, and uppercase hex digits. This commit for each series of these types of names figures out what characters are legal in that series, and adds that info to the hash describing the series. This will be used in a later commit to rule out entire series when matching under some circumstances, without having to try any individual matches within it.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicore/mktables16
-rw-r--r--lib/unicore/uni_keywords.pl2
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 2126268709..d1fb8e4978 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -7505,9 +7505,23 @@ END
push @{$loose_names_ending_in_code_point{$squeezed}->{'high'}},
$high;
+ # Calculate the set of legal characters in names of this
+ # series. It includes every character in the name prefix.
+ my %legal;
+ $legal{$_} = 1 for split //, $map;
+
+ # Plus the hex code point chars, blank, and minus. Also \n
+ # can show up as being required due to anchoring
+ for my $i ('0' .. '9', 'A' .. 'F', '-', ' ', "\n") {
+ $legal{$i} = 1;
+ }
+ my $legal = join "", sort { $a cmp $b } keys %legal;
+
+ # The legal chars can be used in match optimizations
push @code_points_ending_in_code_point, { low => $low,
high => $high,
- name => $map
+ name => $map,
+ legal => $legal,
};
}
}
diff --git a/lib/unicore/uni_keywords.pl b/lib/unicore/uni_keywords.pl
index bcfe12e20c..3a21ccf703 100644
--- a/lib/unicore/uni_keywords.pl
+++ b/lib/unicore/uni_keywords.pl
@@ -1295,7 +1295,7 @@
# baba9dfc133e3cb770a89aaf0973b1341fa61c2da6c176baf6428898b3b568d8 lib/unicore/extracted/DLineBreak.txt
# 6d4a8c945dd7db83ed617cbb7d937de7f4ecf016ff22970d846e996a7c9a2a5d lib/unicore/extracted/DNumType.txt
# 5b7c14380d5cceeaffcfbc18db1ed936391d2af2d51f5a41f1a17b692c77e59b lib/unicore/extracted/DNumValues.txt
-# 91977d5f417fa9252fe9bfebeb61bb28bda9273b630a0e333b6c7b94c8445bca lib/unicore/mktables
+# 3e37ae63c1a4f3084bba787a2c6ca020dad9d0d56e115c118fe8c68ac290ea7a lib/unicore/mktables
# 50b85a67451145545a65cea370dab8d3444fbfe07e9c34cef560c5b7da9d3eef lib/unicore/version
# 2680b9254eb236c5c090f11b149605043e8c8433661b96efc4a42fb4709342a5 regen/charset_translations.pl
# 6bbad21de0848e0236b02f34f5fa0edd3cdae9ba8173cc9469a5513936b9e728 regen/mk_PL_charclass.pl