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