| 1 | package Text::Trac::Macro; | ||||||||||||
| 2 | 53 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 53 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 53 | ▶ | use base qw(Text::Trac::InlineNode Class::Accessor::Fast); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 53 | ▶ | use UNIVERSAL::require; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 53 | ▶ | use Text::ParseWords qw(quotewords); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 53 | our $VERSION = '0.23'; | |||||||||||
| 10 | |||||||||||||
| 11 | 53 | __PACKAGE__->mk_accessors('pattern'); | |||||||||||
| 12 | |||||||||||||
| 13 | sub new { | ||||||||||||
| 14 | 19 | ▶ | my $class = shift; | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 15 | 19 | my $self = {}; | |||||||||||
| 16 | 19 | bless $self, $class; | |||||||||||
| 17 | 19 | return $self; | |||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | sub parse { | ||||||||||||
| 21 | 19 | ▶ | my ( $self, $name, $args, $match ) = @_; | ||||||||||
|
Subroutine
parse: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 22 | 19 | my $c = $self->{context}; | |||||||||||
| 23 | |||||||||||||
| 24 | 19 | ▶ | my @args = $args ? quotewords( ',\s*', 0, $args ) : (); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | 19 | s/^\s+|\s+$//g for @args; | |||||||||||
| 26 | |||||||||||||
| 27 | 19 | foreach my $class ( "Text::Trac::Macro::$name", $name ) { | |||||||||||
| 28 | 35 | ▶ | if ( $class->require ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 3 | ▶ | $match = $class->process( $c, @args ) || ''; | ||||||||||
|
Condition50%1/2
$class->process($c, @args) || ''
MC/DC0%0/1
$class->process($c, @args) || ''
$class->process($c, @args)
Truth table50%1/2
A
A= $class->process($c, @args)
| |||||||||||||
| 30 | 3 | last; | |||||||||||
| 31 | } | ||||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | 19 | return $match; | |||||||||||
| 35 | } | ||||||||||||
| 36 | |||||||||||||
| 37 | 53 | 1; | |||||||||||