diff options
author | Karl Williamson <khw@cpan.org> | 2021-08-21 09:44:37 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-08-31 22:16:38 -0600 |
commit | 3c2792cafcd25f84f84483ee9e35a73261bfa543 (patch) | |
tree | 615e01dc94d2831c4fa0e2345e4326bceb5cb979 /lib | |
parent | e3d65f9f899d4ea3445f8813e16ddef935cb3d06 (diff) | |
download | perl-3c2792cafcd25f84f84483ee9e35a73261bfa543.tar.gz |
Unicode::UCD: Don't depend on a file current syntax
This generated file will be changed in a future commit. This shouldn't
have been relying on its syntax anyway, but the value it returns.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Unicode/UCD.pm | 32 | ||||
-rw-r--r-- | lib/unicore/uni_keywords.pl | 2 |
2 files changed, 16 insertions, 18 deletions
diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index b33f64039d..6f4c4b2502 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -2346,25 +2346,23 @@ my %NAMEDSEQ; sub _namedseq { unless (%NAMEDSEQ) { - my $namedseqfh = openunicode("Name.pl"); - local $_; - local $/ = "\n"; - while (<$namedseqfh>) { - next if m/ ^ \s* \# /x; - - # Each entry is currently two lines. The first contains the code + my @list = split "\n", do "unicore/Name.pl"; + for (my $i = 0; $i < @list; $i += 3) { + # Each entry is currently three lines. The first contains the code # points in the sequence separated by spaces. If this entry # doesn't have spaces, it isn't a named sequence. - if (/^ [0-9A-F]{4,5} (?: \ [0-9A-F]{4,5} )+ $ /x) { - my $sequence = $_; - chomp $sequence; - - # And the second is the name - my $name = <$namedseqfh>; - chomp $name; - my @s = map { chr(hex($_)) } split(' ', $sequence); - $NAMEDSEQ{$name} = join("", @s); - } + next unless $list[$i] =~ /^ [0-9A-F]{4,5} (?: \ [0-9A-F]{4,5} )+ $ /x; + + my $sequence = $list[$i]; + chomp $sequence; + + # And the second is the name + my $name = $list[$i+1]; + chomp $name; + my @s = map { chr(hex($_)) } split(' ', $sequence); + $NAMEDSEQ{$name} = join("", @s); + + # And the third is empty } } } diff --git a/lib/unicore/uni_keywords.pl b/lib/unicore/uni_keywords.pl index 87a93939a0..498d6be481 100644 --- a/lib/unicore/uni_keywords.pl +++ b/lib/unicore/uni_keywords.pl @@ -1247,7 +1247,7 @@ 1; # Generated from: -# f328838dc3474cf31eefa0e8918c2da5b317cb72c373c35886906ac1460879eb lib/Unicode/UCD.pm +# 688d673ec947f7ccf898b4eae9848139d4d33676b688dee54f449f8bf9d3bbd2 lib/Unicode/UCD.pm # ce96627d4fc91b4fd886c409caeb9b76cf7bd345e12f05c6701add7f233f6437 lib/unicore/ArabicShaping.txt # 0e69eef3da722cc104522d8372e86d5b86bb7afcc761b0c991e39e832294946d lib/unicore/BidiBrackets.txt # a00d9d21585106a52113fb7b1d3d0373a5835be72e76862fb559ebddd474d70e lib/unicore/BidiMirroring.txt |