diff options
author | Karl Williamson <khw@cpan.org> | 2021-07-01 08:48:06 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-08-07 04:46:45 -0600 |
commit | d6f90147773df18477f8998a1c0eac389f1269e2 (patch) | |
tree | 83aa229d0d6da1e0d470896236758fa6c1742993 | |
parent | 769444cd0f1c5de5c1dcb9dc4b2b38dd682c85ae (diff) | |
download | perl-d6f90147773df18477f8998a1c0eac389f1269e2.tar.gz |
regcharclass.pl: Make 2 locals into global hashes
This is in preparation for a future commit
-rw-r--r-- | regcharclass.h | 2 | ||||
-rwxr-xr-x | regen/regcharclass.pl | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/regcharclass.h b/regcharclass.h index 0bcf455f97..3b3a823b1a 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -3753,6 +3753,6 @@ * 696e706fddd3ce8cd48c7ea91caf4c9edf5c296432d320aa7b78631f69aa9eac lib/unicore/mktables * 50b85a67451145545a65cea370dab8d3444fbfe07e9c34cef560c5b7da9d3eef lib/unicore/version * 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl - * 3c9ee595e6731a94516e947d5919722eaf6728c8ce324fdd8a92de33decc3e54 regen/regcharclass.pl + * 1568369f6c2d5411cca894445193c91273b4f0666027c5980a268f353b7df148 regen/regcharclass.pl * b2f896452d2b30da3e04800f478c60c1fd0b03d6b668689b020f1e3cf1f1cdd9 regen/regcharclass_multi_char_folds.pl * ex: set ro: */ diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl index 1fec6f92c6..e555945320 100755 --- a/regen/regcharclass.pl +++ b/regen/regcharclass.pl @@ -362,7 +362,9 @@ sub val_fmt # # Return an object +my %a2n; my %n2a; # Inversion of a2n, for each character set +my %I8_2_utf; my %utf_2_I8; # Inversion of I8_2_utf, for each EBCDIC character set sub new { @@ -380,20 +382,20 @@ sub new { }, $class; my $charset = $opt{charset}; - my $a2n = get_a2n($charset); + $a2n{$charset} = get_a2n($charset); # We need to construct the maps going the other way if not already done unless (defined $n2a{$charset}) { for (my $i = 0; $i < 256; $i++) { - $n2a{$charset}->[$a2n->[$i]] = $i; + $n2a{$charset}->[$a2n{$charset}->[$i]] = $i; } } if ($charset =~ /ebcdic/i) { - my $I8_2_utf = get_I8_2_utf($charset); + $I8_2_utf{$charset} = get_I8_2_utf($charset); unless (defined $utf_2_I8{$charset}) { for (my $i = 0; $i < 256; $i++) { - $utf_2_I8{$charset}->[$I8_2_utf->[$i]] = $i; + $utf_2_I8{$charset}->[$I8_2_utf{$charset}->[$i]] = $i; } } } @@ -460,11 +462,11 @@ sub new { die "Unparsable line: $txt\n"; } my ( $cp, $cp_high, $low, $latin1, $utf8 ) - = __uni_latin1($charset, $a2n, $str ); + = __uni_latin1($charset, $a2n{$charset}, $str ); my $from; if (defined $hash_return{"\"$str\""}) { $from = $hash_return{"\"$str\""}; - $from = $a2n->[$from] if $from < 256; + $from = $a2n{$charset}->[$from] if $from < 256; } my $UTF8= $low || $utf8; my $LATIN1= $low || $latin1; |