File Coverage

blib/lib/Acme/MetaSyntactic/unicode.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Acme::MetaSyntactic::unicode;
2 2     2   1217236 use strict;
  2         14  
  2         109  
3 2     2   381 use Acme::MetaSyntactic::List;
  2         14949  
  2         188  
4             our @ISA = qw( Acme::MetaSyntactic::List );
5             our $VERSION = '1.002';
6              
7             {
8             my $data = do(
9             $] < 5.007003
10             ? 'unicode/Name.pl'
11             : 'unicore/Name.pl'
12             );
13 2     2   17 use feature 'say';
  2         13  
  2         1761  
14              
15             # the format of unicore/Name.pl changed in v5.39.10
16             my ( $record_sep, $field_sep) =
17             $] > 5.031009
18             ? ( qr/\n\n/, qr/\n+/ )
19             : ( qr/\n/, qr/\t+/ );
20              
21             # clean up the list
22             my %seen;
23             $data = join ' ', grep !$seen{$_}++, # we might have aliases/duplicates
24             map { s/ \(.*\)//; y/- /_/; $_ }
25             grep { $_ ne '' } # what's this for a character name?
26             map { my @F = split /$field_sep/; @F > 2 ? () : $F[1] } # remove blocks
27             split /$record_sep/, $data;
28              
29             __PACKAGE__->init( { names => $data } );
30             }
31              
32             1;
33              
34             __END__