| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Locale::Maketext::Utils::Phrase::Norm::Compiles; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
1933
|
use strict; |
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
93
|
|
|
4
|
4
|
|
|
4
|
|
10
|
use warnings; |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
69
|
|
|
5
|
4
|
|
|
4
|
|
586
|
use Locale::Maketext::Utils (); |
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
48
|
|
|
6
|
4
|
|
|
4
|
|
394
|
use Locale::Maketext::Utils::Phrase (); |
|
|
4
|
|
|
|
|
26
|
|
|
|
4
|
|
|
|
|
1103
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub normalize_maketext_string { |
|
9
|
89
|
|
|
89
|
0
|
81
|
my ($filter) = @_; |
|
10
|
|
|
|
|
|
|
|
|
11
|
89
|
|
|
|
|
157
|
my $string = $filter->get_orig_str(); |
|
12
|
89
|
|
|
|
|
165
|
my $mt_obj = $filter->get_maketext_object(); |
|
13
|
89
|
|
|
|
|
156
|
my $bn_regexp = Locale::Maketext::Utils::Phrase::get_bn_var_regexp(); |
|
14
|
|
|
|
|
|
|
|
|
15
|
89
|
|
|
|
|
222
|
local $SIG{'__DIE__'}; # cpanel specific: ensure a benign eval does not trigger cpsrvd's DIE handler (may be made moot by internal case 50857) |
|
16
|
89
|
|
|
|
|
96
|
eval { |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# TODO: when we have a phrase class we can pass in proper args to each BN method, for now pass in a bunch of numbers tpo avoid warnings |
|
19
|
89
|
|
|
|
|
68
|
my $n = 0; |
|
20
|
89
|
|
|
|
|
545
|
my @args = map { $n++ } ( $string =~ m/($bn_regexp)/g ); |
|
|
72
|
|
|
|
|
133
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
89
|
|
|
|
|
337
|
$mt_obj->makethis( $string, @args ); |
|
23
|
|
|
|
|
|
|
}; |
|
24
|
|
|
|
|
|
|
|
|
25
|
89
|
100
|
|
|
|
3187
|
if ($@) { |
|
26
|
26
|
|
|
|
|
40
|
my $error = $@; |
|
27
|
|
|
|
|
|
|
|
|
28
|
26
|
|
|
|
|
163
|
$error =~ s/([\[\]])/~$1/g; |
|
29
|
26
|
|
|
|
|
105
|
$error =~ s/[\n\r]+/ /g; |
|
30
|
|
|
|
|
|
|
|
|
31
|
26
|
|
|
|
|
83
|
$string =~ s/([\[\]])/~$1/g; |
|
32
|
26
|
|
|
|
|
206
|
$error =~ s/\Q$string\E.*$/$string/; |
|
33
|
26
|
|
|
|
|
95
|
my $string_sr = $filter->get_string_sr(); |
|
34
|
26
|
100
|
|
|
|
111
|
if ( $error =~ m/Can't locate object method "(.*)" via package "(.*)"/i ) { |
|
|
|
50
|
|
|
|
|
|
|
35
|
10
|
|
|
|
|
31
|
$error = "“$2” does not have a method “$1” in: $string"; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
elsif ( $error =~ m/Undefined subroutine (\S+)/i ) { # odd but theoretically possible |
|
38
|
0
|
|
|
|
|
0
|
my $full_func = $1; |
|
39
|
0
|
|
|
|
|
0
|
my ( $f, @c ) = reverse( split( /::/, $full_func ) ); |
|
40
|
0
|
|
|
|
|
0
|
my $c = join( '::', reverse(@c) ); |
|
41
|
0
|
|
|
|
|
0
|
$error = "“$2” does not have a function “$1” in: $string"; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
26
|
|
|
|
|
47
|
${$string_sr} = "[comment,Bracket Notation Error: $error]"; |
|
|
26
|
|
|
|
|
36
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
26
|
|
|
|
|
51
|
$filter->add_violation('Bracket Notation Error'); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
89
|
|
|
|
|
196
|
return $filter->return_value; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |