line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::Transformer::BasicTypes::Strings::FormatShellStrings; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
10561
|
use 5.006001; |
|
17
|
|
|
|
|
52
|
|
4
|
17
|
|
|
17
|
|
75
|
use strict; |
|
17
|
|
|
|
|
27
|
|
|
17
|
|
|
|
|
333
|
|
5
|
17
|
|
|
17
|
|
62
|
use warnings; |
|
17
|
|
|
|
|
23
|
|
|
17
|
|
|
|
|
425
|
|
6
|
17
|
|
|
17
|
|
103
|
use Readonly; |
|
17
|
|
|
|
|
28
|
|
|
17
|
|
|
|
|
1712
|
|
7
|
|
|
|
|
|
|
|
8
|
17
|
|
|
17
|
|
83
|
use Perl::ToPerl6::Utils qw{ :characters :severities }; |
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
938
|
|
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
4323
|
use base 'Perl::ToPerl6::Transformer'; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
4343
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Readonly::Scalar my $DESC => q{Transform qx{...} to qqx{...}}; |
17
|
|
|
|
|
|
|
Readonly::Scalar my $EXPL => |
18
|
|
|
|
|
|
|
q{Perl6 supports qx{}, but the perl5ish version is qqx{}}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
21
|
|
|
|
|
|
|
|
22
|
40
|
|
|
40
|
0
|
1366
|
sub supported_parameters { return () } |
23
|
28
|
|
|
28
|
1
|
311
|
sub default_severity { return $SEVERITY_HIGHEST } |
24
|
25
|
|
|
25
|
1
|
88
|
sub default_themes { return qw(core bugs) } |
25
|
4
|
|
|
4
|
1
|
10
|
sub applies_to { return 'PPI::Token::QuoteLike::Command' } |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
# A PPI::Token::QuoteLike::Command object contains a single string which has |
31
|
|
|
|
|
|
|
# the entire 'qx{...}' token. Therefore we can't add a Token::Whitespace |
32
|
|
|
|
|
|
|
# between the 'qr' and '{..}' like we can with loops and conditionals. |
33
|
|
|
|
|
|
|
# |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# |
36
|
|
|
|
|
|
|
# qx{...} --> qqx{...} |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
sub transform { |
39
|
0
|
|
|
0
|
0
|
|
my ($self, $elem, $doc) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $content = $elem->content; |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
$content =~ s{^qx\(}{qx (}; |
44
|
0
|
|
|
|
|
|
$content =~ s{^qx}{qqx}; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$elem->set_content( $content ); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return $self->transformation( $DESC, $EXPL, $elem ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=pod |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 NAME |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Perl::ToPerl6::Transformer::BasicTypes::Strings::FormatShellStrings - Format qx{} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AFFILIATION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This Transformer is part of the core L<Perl::ToPerl6|Perl::ToPerl6> |
67
|
|
|
|
|
|
|
distribution. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Perl6 has a C<qx()> operator, but the C<qqx()> operator is more akin to Perl5: |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
qx{..} --> qx{..} |
75
|
|
|
|
|
|
|
qx(..) --> qx (..) |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This enforcer only operates on qx() constructs. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 CONFIGURATION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This Transformer is not configurable except for the standard options. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Jeffrey Goff <drforr@pobox.com> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 COPYRIGHT |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Copyright (c) 2015 Jeffrey Goff |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
92
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
############################################################################## |
97
|
|
|
|
|
|
|
# Local Variables: |
98
|
|
|
|
|
|
|
# mode: cperl |
99
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
100
|
|
|
|
|
|
|
# fill-column: 78 |
101
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
102
|
|
|
|
|
|
|
# c-indentation-style: bsd |
103
|
|
|
|
|
|
|
# End: |
104
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |