line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Error::Pure::ANSIColor::ErrorList; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
72474
|
use base qw(Exporter); |
|
2
|
|
|
|
|
21
|
|
|
2
|
|
|
|
|
307
|
|
4
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
64
|
|
5
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1054
|
use Error::Pure::Utils qw(err_helper); |
|
2
|
|
|
|
|
12046
|
|
|
2
|
|
|
|
|
42
|
|
8
|
2
|
|
|
2
|
|
1205
|
use Error::Pure::Output::ANSIColor qw(err_line_all); |
|
2
|
|
|
|
|
24235
|
|
|
2
|
|
|
|
|
42
|
|
9
|
2
|
|
|
2
|
|
1378
|
use List::MoreUtils qw(none); |
|
2
|
|
|
|
|
27914
|
|
|
2
|
|
|
|
|
14
|
|
10
|
2
|
|
|
2
|
|
2207
|
use Readonly; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
594
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constants. |
13
|
|
|
|
|
|
|
Readonly::Array our @EXPORT_OK => qw(err); |
14
|
|
|
|
|
|
|
Readonly::Scalar my $EVAL => 'eval {...}'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = 0.27; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Process error. |
19
|
|
|
|
|
|
|
sub err { |
20
|
0
|
|
|
0
|
1
|
|
my @msg = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Get errors structure. |
23
|
0
|
|
|
|
|
|
my @errors = err_helper(@msg); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Finalize in main on last err. |
26
|
0
|
|
|
|
|
|
my $stack_ar = $errors[-1]->{'stack'}; |
27
|
0
|
0
|
0
|
|
|
|
if ($stack_ar->[-1]->{'class'} eq 'main' |
28
|
0
|
0
|
|
0
|
|
|
&& none { $_ eq $EVAL || $_ =~ /^eval '/ms } |
29
|
0
|
|
|
|
|
|
map { $_->{'sub'} } @{$stack_ar}) { |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
die err_line_all(@errors); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Die for eval. |
34
|
|
|
|
|
|
|
} else { |
35
|
0
|
|
|
|
|
|
die "$errors[-1]->{'msg'}->[0]\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |