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