line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::Dl; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
56
|
use strict; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
256
|
|
4
|
8
|
|
|
8
|
|
51
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
241
|
|
5
|
8
|
|
|
8
|
|
42
|
use base qw(Text::Trac::BlockNode); |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
53
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.23'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
120
|
|
|
120
|
0
|
243
|
my $self = shift; |
11
|
120
|
|
|
|
|
2492
|
$self->pattern(qr/^\s+(.*)::$/xms); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub parse { |
15
|
3
|
|
|
3
|
0
|
9
|
my ( $self, $l ) = @_; |
16
|
3
|
|
|
|
|
7
|
my $c = $self->{context}; |
17
|
3
|
|
|
|
|
51
|
my $pattern = $self->pattern; |
18
|
|
|
|
|
|
|
|
19
|
3
|
50
|
33
|
|
|
15
|
if ( !@{ $c->in_block_of } or $c->in_block_of->[-1] ne 'dl' ) { |
|
3
|
|
|
|
|
50
|
|
20
|
3
|
|
|
|
|
57
|
$c->htmllines(''); |
21
|
3
|
|
|
|
|
5
|
push @{ $c->in_block_of }, 'dl'; |
|
3
|
|
|
|
|
55
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
32
|
$c->unshiftline; |
25
|
3
|
|
|
|
|
14
|
while ( $c->hasnext ) { |
26
|
19
|
50
|
|
|
|
43
|
last if ( $c->nextline =~ /^$/ ); |
27
|
19
|
|
|
|
|
45
|
my $l = $c->shiftline; |
28
|
|
|
|
|
|
|
|
29
|
19
|
100
|
|
|
|
76
|
if ( $l =~ /$pattern/ ) { |
30
|
6
|
100
|
|
|
|
119
|
if ( $c->in_block_of->[-1] eq 'dd' ) { |
31
|
3
|
|
|
|
|
30
|
$l = "\n$1"; |
32
|
3
|
|
|
|
|
5
|
pop @{ $c->in_block_of }; |
|
3
|
|
|
|
|
55
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
3
|
|
|
|
|
32
|
$l = "$1"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else { |
39
|
13
|
|
|
|
|
50
|
$l =~ s/^\s+//g; |
40
|
13
|
100
|
|
|
|
238
|
if ( $c->in_block_of->[-1] ne 'dd' ) { |
41
|
6
|
|
|
|
|
37
|
$l = "\n$l"; |
42
|
6
|
|
|
|
|
10
|
push @{ $c->in_block_of }, 'dd'; |
|
6
|
|
|
|
|
102
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
19
|
|
|
|
|
88
|
$c->htmllines($l); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
3
|
50
|
|
|
|
55
|
if ( $c->in_block_of->[-1] eq 'dd' ) { |
49
|
3
|
|
|
|
|
26
|
$c->htmllines(''); |
50
|
3
|
|
|
|
|
6
|
pop @{ $c->in_block_of }; |
|
3
|
|
|
|
|
59
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
3
|
|
|
|
|
18
|
pop @{ $c->in_block_of }; |
|
3
|
|
|
|
|
51
|
|
54
|
3
|
|
|
|
|
24
|
$c->htmllines(''); |
55
|
|
|
|
|
|
|
|
56
|
3
|
|
|
|
|
15
|
return; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |