| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package String::IRC; |
|
2
|
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
733210
|
use strict; |
|
|
8
|
|
|
|
|
73
|
|
|
|
8
|
|
|
|
|
281
|
|
|
4
|
8
|
|
|
8
|
|
50
|
use warnings; |
|
|
8
|
|
|
|
|
14
|
|
|
|
8
|
|
|
|
|
182
|
|
|
5
|
8
|
|
|
8
|
|
203
|
use 5.008_005; |
|
|
8
|
|
|
|
|
26
|
|
|
6
|
8
|
|
|
8
|
|
4765
|
use utf8; |
|
|
8
|
|
|
|
|
102
|
|
|
|
8
|
|
|
|
|
41
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use overload ( |
|
11
|
8
|
|
|
|
|
56
|
q{""} => 'stringify', |
|
12
|
|
|
|
|
|
|
fallback => 'stringify', |
|
13
|
8
|
|
|
8
|
|
11060
|
); |
|
|
8
|
|
|
|
|
7923
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
|
16
|
19
|
|
|
19
|
1
|
63366
|
my $class = shift; |
|
17
|
19
|
|
|
|
|
36
|
my $self = {}; |
|
18
|
19
|
|
|
|
|
42
|
bless $self, $class; |
|
19
|
|
|
|
|
|
|
|
|
20
|
19
|
100
|
|
|
|
255
|
$self->{string} = defined $_[0] ? shift : ""; |
|
21
|
|
|
|
|
|
|
|
|
22
|
19
|
|
|
|
|
50
|
return $self; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _add_code_l { |
|
26
|
25
|
|
|
25
|
|
85
|
my ($self, $code) = @_; |
|
27
|
25
|
|
|
|
|
60
|
$self->{string} = $code . $self->{string}; |
|
28
|
25
|
|
|
|
|
58
|
return $self; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my %color_table = ( |
|
32
|
|
|
|
|
|
|
0 => [qw(white)], |
|
33
|
|
|
|
|
|
|
1 => [qw(black)], |
|
34
|
|
|
|
|
|
|
2 => [qw(blue navy)], |
|
35
|
|
|
|
|
|
|
3 => [qw(green)], |
|
36
|
|
|
|
|
|
|
4 => [qw(red)], |
|
37
|
|
|
|
|
|
|
5 => [qw(brown maroon)], |
|
38
|
|
|
|
|
|
|
6 => [qw(purple)], |
|
39
|
|
|
|
|
|
|
7 => [qw(orange olive)], |
|
40
|
|
|
|
|
|
|
8 => [qw(yellow)], |
|
41
|
|
|
|
|
|
|
9 => [qw(light_green lime)], |
|
42
|
|
|
|
|
|
|
10 => [qw(teal)], |
|
43
|
|
|
|
|
|
|
11 => [qw(light_cyan cyan aqua)], |
|
44
|
|
|
|
|
|
|
12 => [qw(light_blue royal)], |
|
45
|
|
|
|
|
|
|
13 => [qw(pink light_purple fuchsia)], |
|
46
|
|
|
|
|
|
|
14 => [qw(grey)], |
|
47
|
|
|
|
|
|
|
15 => [qw(light_grey silver)], |
|
48
|
|
|
|
|
|
|
); |
|
49
|
|
|
|
|
|
|
my %color_name_table; |
|
50
|
|
|
|
|
|
|
{ |
|
51
|
|
|
|
|
|
|
## no critic |
|
52
|
8
|
|
|
8
|
|
2021
|
no strict 'refs'; |
|
|
8
|
|
|
|
|
15
|
|
|
|
8
|
|
|
|
|
2791
|
|
|
53
|
|
|
|
|
|
|
while (my ($code, $colors) = each %color_table) { |
|
54
|
|
|
|
|
|
|
for my $color (@$colors) { |
|
55
|
|
|
|
|
|
|
$color_name_table{ $color } = $code; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
*{__PACKAGE__.'::'.$color} = sub { |
|
58
|
11
|
|
|
11
|
|
176
|
my $color_code = ""; |
|
59
|
11
|
100
|
66
|
|
|
48
|
if ($_[1] && exists $color_name_table{ $_[1] }) { |
|
60
|
3
|
|
|
|
|
19
|
$color_code .= sprintf "%02d,%02d", $code, $color_name_table{ $_[1] }; |
|
61
|
|
|
|
|
|
|
} else { |
|
62
|
8
|
|
|
|
|
43
|
$color_code .= sprintf "%02d", $code; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
11
|
|
|
|
|
39
|
$_[0]->_add_code_l("$color_code"); |
|
65
|
|
|
|
|
|
|
}; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
9
|
|
|
9
|
1
|
135
|
sub bold { $_[0]->_add_code_l(""); } |
|
71
|
3
|
|
|
3
|
1
|
25
|
sub underline { $_[0]->_add_code_l(""); } |
|
72
|
2
|
|
|
2
|
1
|
26
|
sub inverse { $_[0]->_add_code_l(""); } |
|
73
|
|
|
|
|
|
|
|
|
74
|
21
|
|
|
21
|
1
|
2064
|
sub stringify { $_[0]->{string} . ""; } |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |