line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::Macro; |
2
|
9
|
|
|
9
|
|
71
|
use strict; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
286
|
|
3
|
9
|
|
|
9
|
|
60
|
use warnings; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
305
|
|
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
50
|
use base qw(Text::Trac::InlineNode Class::Accessor::Fast); |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
142
|
|
6
|
9
|
|
|
9
|
|
1144
|
use UNIVERSAL::require; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
48
|
|
7
|
9
|
|
|
9
|
|
4519
|
use Text::ParseWords qw(quotewords); |
|
9
|
|
|
|
|
12121
|
|
|
9
|
|
|
|
|
2070
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.22'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors('pattern'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
4
|
|
|
4
|
1
|
9
|
my $class = shift; |
15
|
4
|
|
|
|
|
11
|
my $self = {}; |
16
|
4
|
|
|
|
|
8
|
bless $self, $class; |
17
|
4
|
|
|
|
|
18
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub parse { |
21
|
4
|
|
|
4
|
0
|
13
|
my ( $self, $name, $args, $match ) = @_; |
22
|
4
|
|
|
|
|
13
|
my $c = $self->{context}; |
23
|
|
|
|
|
|
|
|
24
|
4
|
100
|
|
|
|
17
|
my @args = $args ? quotewords( ',\s*', 0, $args ) : (); |
25
|
4
|
|
|
|
|
398
|
s/^\s+|\s+$//g for @args; |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
16
|
foreach my $class ( "Text::Trac::Macro::$name", $name ) { |
28
|
5
|
100
|
|
|
|
61
|
if ( $class->require ) { |
29
|
3
|
|
50
|
|
|
88
|
$match = $class->process( $c, @args ) || ''; |
30
|
3
|
|
|
|
|
8
|
last; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
|
|
68
|
return $match; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |