| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mo::utils::Unicode; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
265891
|
use base qw(Exporter); |
|
|
5
|
|
|
|
|
14
|
|
|
|
5
|
|
|
|
|
764
|
|
|
4
|
5
|
|
|
5
|
|
46
|
use strict; |
|
|
5
|
|
|
|
|
28
|
|
|
|
5
|
|
|
|
|
171
|
|
|
5
|
5
|
|
|
5
|
|
29
|
use warnings; |
|
|
5
|
|
|
|
|
10
|
|
|
|
5
|
|
|
|
|
366
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
2856
|
use Error::Pure qw(err); |
|
|
5
|
|
|
|
|
32642
|
|
|
|
5
|
|
|
|
|
132
|
|
|
8
|
5
|
|
|
5
|
|
473
|
use List::Util 1.33 qw(none); |
|
|
5
|
|
|
|
|
117
|
|
|
|
5
|
|
|
|
|
755
|
|
|
9
|
5
|
|
|
5
|
|
3007
|
use Mo::utils::Array qw(check_array); |
|
|
5
|
|
|
|
|
27958
|
|
|
|
5
|
|
|
|
|
2226
|
|
|
10
|
5
|
|
|
5
|
|
513
|
use Readonly; |
|
|
5
|
|
|
|
|
10
|
|
|
|
5
|
|
|
|
|
328
|
|
|
11
|
5
|
|
|
5
|
|
6244
|
use Unicode::UCD qw(charblocks charscripts); |
|
|
5
|
|
|
|
|
302324
|
|
|
|
5
|
|
|
|
|
12257
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(check_array_unicode_block check_unicode_block check_unicode_script); |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = 0.02; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub check_array_unicode_block { |
|
18
|
4
|
|
|
4
|
1
|
440509
|
my ($self, $key) = @_; |
|
19
|
|
|
|
|
|
|
|
|
20
|
4
|
100
|
|
|
|
21
|
if (! exists $self->{$key}) { |
|
21
|
1
|
|
|
|
|
4
|
return; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
18
|
check_array($self, $key); |
|
25
|
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
24
|
foreach my $unicode_block (@{$self->{$key}}) { |
|
|
2
|
|
|
|
|
7
|
|
|
27
|
3
|
|
|
|
|
13
|
_check_unicode_block($unicode_block, $key); |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
7
|
return; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub check_unicode_block { |
|
34
|
3
|
|
|
3
|
1
|
430969
|
my ($self, $key) = @_; |
|
35
|
|
|
|
|
|
|
|
|
36
|
3
|
100
|
|
|
|
17
|
if (! exists $self->{$key}) { |
|
37
|
1
|
|
|
|
|
3
|
return; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
2
|
|
|
|
|
11
|
_check_unicode_block($self->{$key}, $key); |
|
41
|
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
7
|
return; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub check_unicode_script { |
|
46
|
3
|
|
|
3
|
1
|
337639
|
my ($self, $key) = @_; |
|
47
|
|
|
|
|
|
|
|
|
48
|
3
|
100
|
|
|
|
12
|
if (! exists $self->{$key}) { |
|
49
|
1
|
|
|
|
|
2
|
return; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
2
|
100
|
|
276
|
|
9
|
if (none { $self->{$key} eq $_ } keys %{charscripts()}) { |
|
|
276
|
|
|
|
|
52038
|
|
|
|
2
|
|
|
|
|
8
|
|
|
53
|
|
|
|
|
|
|
err "Parameter '".$key."' contains invalid Unicode script.", |
|
54
|
1
|
|
|
|
|
8
|
'Value', $self->{$key}, |
|
55
|
|
|
|
|
|
|
; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
152
|
return; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub _check_unicode_block { |
|
62
|
5
|
|
|
5
|
|
15
|
my ($value, $key) = @_; |
|
63
|
|
|
|
|
|
|
|
|
64
|
5
|
100
|
|
1078
|
|
32
|
if (none { $value eq $_ } keys %{charblocks()}) { |
|
|
1078
|
|
|
|
|
22255
|
|
|
|
5
|
|
|
|
|
29
|
|
|
65
|
2
|
|
|
|
|
23
|
err "Parameter '".$key."' contains invalid Unicode block.", |
|
66
|
|
|
|
|
|
|
'Value', $value, |
|
67
|
|
|
|
|
|
|
; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
3
|
|
|
|
|
410
|
return; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |