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