line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::Table; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
58
|
use strict; |
|
8
|
|
|
|
|
27
|
|
|
8
|
|
|
|
|
248
|
|
4
|
8
|
|
|
8
|
|
46
|
use warnings; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
220
|
|
5
|
8
|
|
|
8
|
|
40
|
use base qw(Text::Trac::BlockNode); |
|
8
|
|
|
|
|
24
|
|
|
8
|
|
|
|
|
40
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.23'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
120
|
|
|
120
|
0
|
263
|
my $self = shift; |
11
|
120
|
|
|
|
|
2485
|
$self->pattern(qr/^\|\|([^\|]*\|\|(?:[^\|]*\|\|)+)$/xms); |
12
|
120
|
|
|
|
|
843
|
return $self; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub parse { |
16
|
2
|
|
|
2
|
0
|
9
|
my ( $self, $l ) = @_; |
17
|
2
|
|
|
|
|
6
|
my $c = $self->{context}; |
18
|
2
|
|
|
|
|
36
|
my $pattern = $self->pattern; |
19
|
2
|
50
|
|
|
|
28
|
$l =~ $pattern or return $l; |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
12
|
$c->htmllines('');
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
12
|
$c->unshiftline; |
24
|
2
|
|
100
|
|
|
9
|
while ( $c->hasnext and ( $c->nextline =~ $pattern ) ) { |
25
|
3
|
|
|
|
|
12
|
my $l = $c->shiftline; |
26
|
3
|
|
|
|
|
78
|
$l =~ s{ $self->{pattern} }{$1}xmsg; |
27
|
|
|
|
|
|
|
$l = ' | ' . join( |
28
|
|
|
|
|
|
|
' | ', |
29
|
|
|
|
|
|
|
map { |
30
|
3
|
|
|
|
|
19
|
$self->replace($_) # parse inline nodes |
|
9
|
|
|
|
|
245
|
|
31
|
|
|
|
|
|
|
} split( /\|\|/, $l ) |
32
|
|
|
|
|
|
|
) . ' | ';
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
|
|
130
|
$c->htmllines($l); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
12
|
$c->htmllines(' | '); |
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
|
|
8
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |