line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Term::ANSIColor::Markup; |
2
|
4
|
|
|
4
|
|
2271
|
use 5.008_001; |
|
4
|
|
|
|
|
19
|
|
|
4
|
|
|
|
|
243
|
|
3
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
114
|
|
4
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
110
|
|
5
|
4
|
|
|
4
|
|
3725
|
use Term::ANSIColor::Markup::Parser; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
42
|
|
6
|
4
|
|
|
4
|
|
203
|
use base qw(Class::Accessor::Lvalue::Fast); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
549
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(parser text)); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
9
|
|
|
9
|
1
|
41
|
my $class = shift; |
14
|
9
|
|
|
|
|
61
|
bless { |
15
|
|
|
|
|
|
|
parser => Term::ANSIColor::Markup::Parser->new, |
16
|
|
|
|
|
|
|
text => '', |
17
|
|
|
|
|
|
|
}, $class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub parse { |
21
|
9
|
|
|
9
|
1
|
36
|
my ($self, $text) = @_; |
22
|
9
|
|
|
|
|
38
|
$self->parser->parse($text); |
23
|
8
|
|
|
|
|
90
|
$self->parser->eof; |
24
|
8
|
|
|
|
|
29
|
$self->text = $self->parser->text; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub colorize { |
28
|
5
|
|
|
5
|
1
|
39
|
my ($class, $text) = @_; |
29
|
5
|
|
|
|
|
19
|
my $self = $class->new; |
30
|
5
|
|
|
|
|
27
|
$self->parse($text); |
31
|
4
|
|
|
|
|
28
|
$self->text; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |