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