| 1 | package Perl::ToPerl6::Transformer::Builtins::Rename; | ||
| 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 | 17 | ▶ | use Perl::ToPerl6::Utils::PPI qw{ is_ppi_token_word }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 17 | ▶ | use base 'Perl::ToPerl6::Transformer'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | #----------------------------------------------------------------------------- | ||
| 14 | |||
| 15 | 17 | Readonly::Scalar my $DESC => q{Rename builtins}; | |
| 16 | 17 | Readonly::Scalar my $EXPL => q{Rename builtins}; | |
| 17 | |||
| 18 | #----------------------------------------------------------------------------- | ||
| 19 | |||
| 20 | 17 | my %map = ( | |
| 21 | eval => 'EVAL', | ||
| 22 | ); | ||
| 23 | |||
| 24 | 38 | ▶ | sub supported_parameters { return () } |
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 25 | 27 | ▶ | sub default_necessity { return $NECESSITY_HIGHEST } |
|
Subroutine
default_necessity: called CC=1 SCAR=0.0
Pod
documented
| |||
| 26 | 24 | ▶ | sub default_themes { return qw( core ) } |
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||
| 27 | 5 | ▶ | sub applies_to { |
|
Subroutine
applies_to: called CC=1 SCAR=0.0
Pod
documented
| |||
| 28 | 78 | ▶ | return sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 29 | 78 | is_ppi_token_word($_[1], %map) | |
| 30 | } | ||
| 31 | 5 | } | |
| 32 | |||
| 33 | #----------------------------------------------------------------------------- | ||
| 34 | |||
| 35 | 0 | ▶ | sub transform { |
|
Subroutine
transform: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 36 | 0 | my ($self, $elem, $doc) = @_; | |
| 37 | |||
| 38 | $elem->set_content( | ||
| 39 | 0 | $map{$elem->content} | |
| 40 | ); | ||
| 41 | |||
| 42 | 0 | return $self->transformation( $DESC, $EXPL, $elem ); | |
| 43 | } | ||
| 44 | |||
| 45 | 17 | 1; | |
| 46 | |||
| 47 | #----------------------------------------------------------------------------- | ||
| 48 | |||
| 49 | __END__ | ||