summaryrefslogtreecommitdiff
path: root/regen/mk_invlists.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-01-30 12:39:12 -0700
committerKarl Williamson <khw@cpan.org>2020-01-30 14:39:32 -0700
commit18072598220543466e594e6cdc03a1ceaba0b2fe (patch)
treee6919bf723c119452f4683f8eea5f0dbeca27224 /regen/mk_invlists.pl
parentcf2cd61916d700e50f4854db59d6c298b9f133e8 (diff)
downloadperl-18072598220543466e594e6cdc03a1ceaba0b2fe.tar.gz
regen/mk_invlists.pl: Do sort caselessly in places
This makes things more like dictionary order
Diffstat (limited to 'regen/mk_invlists.pl')
-rw-r--r--regen/mk_invlists.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index 2a1efcf7fd..bb09f805a6 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -186,6 +186,8 @@ sub uniques {
return grep { ! $seen{$_}++ } @_;
}
+sub caselessly { lc $a cmp lc $b }
+
sub a2n($) {
my $cp = shift;
@@ -405,7 +407,7 @@ sub output_invmap ($$$$$$$) {
# expand the sublists first.
if ($input_format !~ / ^ a /x) {
if ($input_format ne 'sl') {
- @input_enums = sort(uniques(@$invmap));
+ @input_enums = sort caselessly uniques(@$invmap);
}
else {
foreach my $element (@$invmap) {
@@ -416,7 +418,7 @@ sub output_invmap ($$$$$$$) {
push @input_enums, $element;
}
}
- @input_enums = sort(uniques(@input_enums));
+ @input_enums = sort caselessly uniques(@input_enums);
}
}
@@ -459,7 +461,7 @@ sub output_invmap ($$$$$$$) {
}
}
- @unused_enums = sort @unused_enums;
+ @unused_enums = sort caselessly @unused_enums;
$unused_enum_value = @enums; # All unused have the same value,
# one beyond the final used one
}
@@ -633,7 +635,7 @@ sub output_invmap ($$$$$$$) {
$joined = join ",", @$element;
}
else {
- $joined = join ",", sort @$element;
+ $joined = join ",", sort caselessly @$element;
}
my $already_found = exists $multiples{$joined};
@@ -1237,7 +1239,7 @@ sub output_table_common {
# If we have annotations, output it now.
if ($has_unused || scalar %$abbreviations_ref) {
my $text = "";
- foreach my $abbr (sort keys %$abbreviations_ref) {
+ foreach my $abbr (sort caselessly keys %$abbreviations_ref) {
$text .= "; " if $text;
$text .= "'$abbr' stands for '$abbreviations_ref->{$abbr}'";
}