line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::Transformer::Builtins::Rename; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
768
|
use 5.006001; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
6
|
use Readonly; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Perl::ToPerl6::Utils qw{ :severities }; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
9
|
1
|
|
|
1
|
|
116
|
use Perl::ToPerl6::Utils::PPI qw{ is_ppi_token_word }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use base 'Perl::ToPerl6::Transformer'; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
234
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Readonly::Scalar my $DESC => q{Rename builtins}; |
16
|
|
|
|
|
|
|
Readonly::Scalar my $EXPL => q{Rename builtins}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my %map = ( |
21
|
|
|
|
|
|
|
eval => 'EVAL', |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
0
|
3
|
sub supported_parameters { return () } |
25
|
1
|
|
|
1
|
1
|
4
|
sub default_necessity { return $NECESSITY_HIGHEST } |
26
|
0
|
|
|
0
|
1
|
|
sub default_themes { return qw( core ) } |
27
|
|
|
|
|
|
|
sub applies_to { |
28
|
|
|
|
|
|
|
return sub { |
29
|
0
|
|
|
0
|
|
|
is_ppi_token_word($_[1], %map) |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
0
|
1
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub transform { |
36
|
0
|
|
|
0
|
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
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Perl::ToPerl6::Transformer::Buiiltins::Rename - Format my(), our(), print() |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AFFILIATION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This Transformer is part of the core L<Perl::ToPerl6|Perl::ToPerl6> distribution. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Perl6 requires whitespace after C<my>, C<our>, C<print> etc. in order to not confuse these builtins with methods: |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my() --> my () |
68
|
|
|
|
|
|
|
our() --> our () |
69
|
|
|
|
|
|
|
print() --> print () |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 CONFIGURATION |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This Transformer is not configurable except for the standard options. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 AUTHOR |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Jeffrey Goff <drforr@pobox.com> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 COPYRIGHT |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Copyright (c) 2015 Jeffrey Goff |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
84
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
############################################################################## |
89
|
|
|
|
|
|
|
# Local Variables: |
90
|
|
|
|
|
|
|
# mode: cperl |
91
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
92
|
|
|
|
|
|
|
# fill-column: 78 |
93
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
94
|
|
|
|
|
|
|
# c-indentation-style: bsd |
95
|
|
|
|
|
|
|
# End: |
96
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |