summaryrefslogtreecommitdiff
path: root/regen/mk_invlists.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-12-06 16:57:17 -0700
committerKarl Williamson <khw@cpan.org>2018-12-07 10:55:20 -0700
commit3601832e0e3e0dc07d27e6e3da50ad346500f469 (patch)
tree3929864694fff729748eaa2dfa98188e81487b8c /regen/mk_invlists.pl
parent85b52c7a801df3fe16026c0c2ff86663e8c4132e (diff)
downloadperl-3601832e0e3e0dc07d27e6e3da50ad346500f469.tar.gz
regen/mk_invlists.pl: Add new table
This table contains all the code points that are in any multi-character fold (not the folded-from character, but what that character folds to). It will be used in a future commit.
Diffstat (limited to 'regen/mk_invlists.pl')
-rw-r--r--regen/mk_invlists.pl18
1 files changed, 15 insertions, 3 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index 7f1347cb5c..980b90cafe 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -887,17 +887,28 @@ die "Could not find inversion map for Case_Folding" unless defined $format;
die "Incorrect format '$format' for Case_Folding inversion map"
unless $format eq 'al'
|| $format eq 'a';
+my @is_in_multi_char_fold;
my @is_non_final_fold;
for my $i (0 .. @$folds_ref - 1) {
next unless ref $folds_ref->[$i]; # Skip single-char folds
- # Add to the non-finals list each code point that is in a non-final
- # position
- for my $j (0 .. @{$folds_ref->[$i]} - 2) {
+ # Add to the is_in_multis ls list each code point that is in a
+ # multi-character fold, and to the non-finals list each code point that is
+ # in a non-final position
+ for my $j (0 .. @{$folds_ref->[$i]} - 1) {
+ push @is_in_multi_char_fold, $folds_ref->[$i][$j];
+ last if $j == @{$folds_ref->[$i]} - 1;
push @is_non_final_fold, $folds_ref->[$i][$j];
}
@is_non_final_fold = uniques @is_non_final_fold;
+ @is_in_multi_char_fold = uniques @is_in_multi_char_fold;
+}
+
+sub _Perl_Is_In_Multi_Char_Fold {
+ @is_in_multi_char_fold = sort { $a <=> $b } @is_in_multi_char_fold;
+ my @return = mk_invlist_from_sorted_cp_list(\@is_in_multi_char_fold);
+ return \@return;
}
sub _Perl_Non_Final_Folds {
@@ -2338,6 +2349,7 @@ no warnings 'qw';
my @props;
push @props, sort { prop_name_for_cmp($a) cmp prop_name_for_cmp($b) } qw(
&NonL1_Perl_Non_Final_Folds
+ &_Perl_Is_In_Multi_Char_Fold
&UpperLatin1
_Perl_GCB,EDGE,E_Base,E_Base_GAZ,E_Modifier,Glue_After_Zwj,LV,Prepend,Regional_Indicator,SpacingMark,ZWJ,XPG_XX
_Perl_LB,EDGE,Close_Parenthesis,Hebrew_Letter,Next_Line,Regional_Indicator,ZWJ,Contingent_Break,E_Base,E_Modifier,H2,H3,JL,JT,JV,Word_Joiner