« lib/Perl/ToPerl6/Config.pm
↑ Summary
lib/Perl/ToPerl6/TransformerParameter/Behavior/Enumeration.pm »
| 1 | package Perl::ToPerl6::Transformer::References::RewriteDereferences; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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{Transform %x{a} to %x{'a'}}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 17 | Readonly::Scalar my $EXPL => | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | q{Perl6 assumes that braces are code blocks, so any content must be compilable}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 31 | ▶ | sub run_after { return 'Operators::FormatOperators' } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run_after: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 38 | ▶ | sub supported_parameters { return () } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 27 | ▶ | sub default_necessity { return $NECESSITY_HIGHEST } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_necessity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 24 | ▶ | sub default_themes { return qw( core ) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 5 | ▶ | sub applies_to { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
applies_to: called CC=1 SCAR=1.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 82 | ▶ | return sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=23.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 82 | ▶ | $_[1]->isa('PPI::Token::Cast') and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$_[1]->isa("PPI::Token::Cast") and $_[1]->next_sibling and $_[1]->next_sibling->isa("PPI::Structure::Block") and $_[1]->next_sibling->start->content eq "{"
$_[1]->isa("PPI::Token::Cast") and $_[1]->next_sibling and $_[1]->next_sibling->isa("PPI::Structure::Block")
$_[1]->isa("PPI::Token::Cast") and $_[1]->next_sibling
MC/DC0%0/4
$_[1]->isa("PPI::Token::Cast") and $_[1]->next_sibling and $_[1]->next_sibling->isa("PPI::Structure::Block") and $_[1]->next_sibling->start->content eq "{"
$_[1]->isa("PPI::Token::Cast")
$_[1]->next_sibling
$_[1]->next_sibling->isa("PPI::Structure::Block")
$_[1]->next_sibling->start->content eq "{"
Truth table20%1/5
A and B and C and D
A= $_[1]->isa("PPI::Token::Cast")B= $_[1]->next_siblingC= $_[1]->next_sibling->isa("PPI::Structure::Block")D= $_[1]->next_sibling->start->content eq "{"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | $_[1]->next_sibling and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | $_[1]->next_sibling->isa('PPI::Structure::Block') and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | $_[1]->next_sibling->start->content eq '{' and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | $_[1]->next_sibling->finish->content eq '}' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 5 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub transform { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
transform: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | my ($self, $elem, $doc) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my $next = $elem->next_sibling; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $next->start->set_content('('); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | $next->finish->set_content(')'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if ( $elem->content eq '$#' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | $elem->set_content('@'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | $elem->snext_sibling->insert_after( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | PPI::Token::Word->new('end') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | $elem->snext_sibling->insert_after( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | PPI::Token::Operator->new('.') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | return $self->transformation( $DESC, $EXPL, $elem ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 17 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||