| 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.001'; | |||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | { | ||||||||||||||||||||||||||||||||
| 8 | # a very basic list | ||||||||||||||||||||||||||||||||
| 9 | 2 | my $data = join "\n", | |||||||||||||||||||||||||||||||
| 10 | 2 | map { ( "\t\tLATIN CAPITAL LETTER $_", "\t\tLATIN SMALL LETTER $_" ) } | |||||||||||||||||||||||||||||||
| 11 | 'A' .. 'Z'; | ||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | # try to find better | ||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | if ( $] >= 5.006 && $] < 5.007003 ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
$] >= "5.006" and $] < "5.007003"
MC/DC0%0/2
$] >= "5.006" and $] < "5.007003"
$] >= "5.006"
$] < "5.007003"
Truth table33%1/3
A and B
A= $] >= "5.006"B= $] < "5.007003"
| |||||||||||||||||||||||||||||||||
| 15 | 0 | eval { $data = require 'unicode/Name.pl'; }; | |||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||
| 17 | elsif ( $] >= 5.007003 ) { | ||||||||||||||||||||||||||||||||
| 18 | 2 | eval { $data = require 'unicore/Name.pl'; }; | |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | # since v5.11.3, unicore/Name.pl creates subroutines | ||||||||||||||||||||||||||||||||
| 21 | # they end up in our namespace, so get rid of them | ||||||||||||||||||||||||||||||||
| 22 | 2 | undef *code_point_to_name_special; | |||||||||||||||||||||||||||||||
| 23 | 2 | undef *name_to_code_point_special; | |||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | # clean up the list | ||||||||||||||||||||||||||||||||
| 27 | 2 | my %seen; | |||||||||||||||||||||||||||||||
| 28 | $data = join ' ', | ||||||||||||||||||||||||||||||||
| 29 | grep !$seen{$_}++, # we might have aliases/duplicates | ||||||||||||||||||||||||||||||||
| 30 | 213238 | map { s/ \(.*\)//; y/- /_/; $_ } | |||||||||||||||||||||||||||||||
| 31 | 213238 | grep { $_ ne '<control>' } # what's this for a character name? | |||||||||||||||||||||||||||||||
| 32 | 2 | ▶ | map { my @F = split /\t+/; @F > 2 ? () : $F[1] } # remove blocks | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 33 | split /\n/, $data; | ||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||
| 35 | 2 | __PACKAGE__->init( { names => $data } ); | |||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | 2 | 1; | |||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||||||