line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::Macro; |
2
|
9
|
|
|
9
|
|
54
|
use strict; |
|
9
|
|
|
|
|
45
|
|
|
9
|
|
|
|
|
283
|
|
3
|
9
|
|
|
9
|
|
42
|
use warnings; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
240
|
|
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
41
|
use base qw(Text::Trac::InlineNode Class::Accessor::Fast); |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
118
|
|
6
|
9
|
|
|
9
|
|
1038
|
use UNIVERSAL::require; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
38
|
|
7
|
9
|
|
|
9
|
|
3626
|
use Text::ParseWords qw(quotewords); |
|
9
|
|
|
|
|
10132
|
|
|
9
|
|
|
|
|
1747
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.24'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors('pattern'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
4
|
|
|
4
|
1
|
8
|
my $class = shift; |
15
|
4
|
|
|
|
|
7
|
my $self = {}; |
16
|
4
|
|
|
|
|
8
|
bless $self, $class; |
17
|
4
|
|
|
|
|
21
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub parse { |
21
|
4
|
|
|
4
|
0
|
13
|
my ( $self, $name, $args, $match ) = @_; |
22
|
4
|
|
|
|
|
12
|
my $c = $self->{context}; |
23
|
|
|
|
|
|
|
|
24
|
4
|
100
|
|
|
|
16
|
my @args = $args ? quotewords( ',\s*', 0, $args ) : (); |
25
|
4
|
|
|
|
|
332
|
s/^\s+|\s+$//g for @args; |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
15
|
foreach my $class ( "Text::Trac::Macro::$name", $name ) { |
28
|
5
|
100
|
|
|
|
57
|
if ( $class->require ) { |
29
|
3
|
|
50
|
|
|
77
|
$match = $class->process( $c, @args ) || ''; |
30
|
3
|
|
|
|
|
7
|
last; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
|
|
60
|
return $match; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |