« lib/Perl/ToPerl6/TransformerParameter/Behavior/Boolean.pm
↑ Summary
lib/Perl/ToPerl6/ThemeListing.pm »
| 1 | package Perl::ToPerl6::Transformer::BasicTypes::Strings::AddWhitespace; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 17 | ▶ | use 5.006001; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 17 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 17 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 17 | ▶ | use Readonly; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 17 | ▶ | use Perl::ToPerl6::Utils qw{ :severities }; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 17 | ▶ | use base 'Perl::ToPerl6::Transformer'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 17 | Readonly::Scalar my $DESC => q{Rewrite interpolated strings}; | |||||||||||||||||||||||||||
| 15 | 17 | Readonly::Scalar my $EXPL => q{Rewrite interpolated strings}; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 38 | ▶ | sub supported_parameters { return () } | ||||||||||||||||||||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 27 | ▶ | sub default_necessity { return $NECESSITY_HIGHEST } | ||||||||||||||||||||||||||
|
Subroutine
default_necessity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 24 | ▶ | sub default_themes { return qw( core ) } | ||||||||||||||||||||||||||
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 5 | ▶ | sub applies_to { | ||||||||||||||||||||||||||
|
Subroutine
applies_to: called CC=1 SCAR=0.2
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 78 | ▶ | return sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=12.0
| |||||||||||||||||||||||||||||
| 24 | $_[1]->isa('PPI::Token::Quote') and | ||||||||||||||||||||||||||||
| 25 | $_[1]->{operator} and | ||||||||||||||||||||||||||||
| 26 | 78 | ▶ | $_[1]->{operator} =~ / ^ q /x | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$_[1]->isa("PPI::Token::Quote") and $_[1]{"operator"}
MC/DC0%0/2
$_[1]->isa("PPI::Token::Quote") and $_[1]{"operator"}
$_[1]->isa("PPI::Token::Quote")
$_[1]{"operator"}
Truth table66%2/3
A and B
A= $_[1]->isa("PPI::Token::Quote")B= $_[1]{"operator"}
| |||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 5 | } | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub transform { | ||||||||||||||||||||||||||
|
Subroutine
transform: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 0 | my ($self, $elem, $doc) = @_; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | my $new_content = $elem->content; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | $new_content =~ s{ ^ (q?q)[(] }{$1 (}x; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | $elem->set_content( $new_content ); | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | return $self->transformation( $DESC, $EXPL, $elem ); | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 17 | 1; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | __END__ | ||||||||||||||||||||||||||||