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