line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::Utils::Constants; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
15
|
use 5.006001; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
6
|
1
|
|
|
1
|
|
4
|
use Readonly; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use Perl::ToPerl6::Utils qw{ $EMPTY hashify }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
80
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use Exporter 'import'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
372
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw{ |
15
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_WARN |
16
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_FATAL |
17
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_QUIET |
18
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_DEFAULT |
19
|
|
|
|
|
|
|
%PROFILE_STRICTNESSES |
20
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_HIGHEST_DEFAULT |
21
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_HIGH_DEFAULT |
22
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_MEDIUM_DEFAULT |
23
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_LOW_DEFAULT |
24
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_LOWEST_DEFAULT |
25
|
|
|
|
|
|
|
$_MODULE_VERSION_TERM_ANSICOLOR |
26
|
|
|
|
|
|
|
@STRICT_EQUIVALENT_MODULES |
27
|
|
|
|
|
|
|
@WARNINGS_EQUIVALENT_MODULES |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
31
|
|
|
|
|
|
|
all => \@EXPORT_OK, |
32
|
|
|
|
|
|
|
profile_strictness => [ |
33
|
|
|
|
|
|
|
qw{ |
34
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_WARN |
35
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_FATAL |
36
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_QUIET |
37
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_DEFAULT |
38
|
|
|
|
|
|
|
%PROFILE_STRICTNESSES |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
], |
41
|
|
|
|
|
|
|
color_necessity => [ |
42
|
|
|
|
|
|
|
qw{ |
43
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_HIGHEST_DEFAULT |
44
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_HIGH_DEFAULT |
45
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_MEDIUM_DEFAULT |
46
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_LOW_DEFAULT |
47
|
|
|
|
|
|
|
$PROFILE_COLOR_NECESSITY_LOWEST_DEFAULT |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
], |
50
|
|
|
|
|
|
|
equivalent_modules => [ |
51
|
|
|
|
|
|
|
qw{ |
52
|
|
|
|
|
|
|
@STRICT_EQUIVALENT_MODULES |
53
|
|
|
|
|
|
|
@WARNINGS_EQUIVALENT_MODULES |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
], |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_STRICTNESS_WARN => 'warn'; |
61
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_STRICTNESS_FATAL => 'fatal'; |
62
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_STRICTNESS_QUIET => 'quiet'; |
63
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_STRICTNESS_DEFAULT => $PROFILE_STRICTNESS_WARN; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Readonly::Hash our %PROFILE_STRICTNESSES => |
66
|
|
|
|
|
|
|
hashify( |
67
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_WARN, |
68
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_FATAL, |
69
|
|
|
|
|
|
|
$PROFILE_STRICTNESS_QUIET, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_COLOR_NECESSITY_HIGHEST_DEFAULT => 'bold red'; |
73
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_COLOR_NECESSITY_HIGH_DEFAULT => 'magenta'; |
74
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_COLOR_NECESSITY_MEDIUM_DEFAULT => $EMPTY; |
75
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_COLOR_NECESSITY_LOW_DEFAULT => $EMPTY; |
76
|
|
|
|
|
|
|
Readonly::Scalar our $PROFILE_COLOR_NECESSITY_LOWEST_DEFAULT => $EMPTY; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# If the following changes, the corresponding change needs to be made in |
79
|
|
|
|
|
|
|
# inc/Perl/ToPerl6/BuildUtilities.pm, sub recommended_module_versions(). |
80
|
|
|
|
|
|
|
Readonly::Scalar our $_MODULE_VERSION_TERM_ANSICOLOR => 2.02; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Readonly::Array our @STRICT_EQUIVALENT_MODULES => qw( |
83
|
|
|
|
|
|
|
Mo |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Moo |
86
|
|
|
|
|
|
|
Moo::Role |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Moose |
89
|
|
|
|
|
|
|
Moose::Role |
90
|
|
|
|
|
|
|
Moose::Exporter |
91
|
|
|
|
|
|
|
Moose::Util::TypeConstraints |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
MooseX::NonMoose |
94
|
|
|
|
|
|
|
MooseX::Singleton |
95
|
|
|
|
|
|
|
MooseX::Role::Parameterized |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Mouse |
98
|
|
|
|
|
|
|
Mouse::Role |
99
|
|
|
|
|
|
|
Mouse::Exporter |
100
|
|
|
|
|
|
|
Mouse::Util::TypeConstraints |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Modern::Perl |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Dancer |
105
|
|
|
|
|
|
|
Dancer2 |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Mojolicious::Lite |
108
|
|
|
|
|
|
|
Mojo::Base |
109
|
|
|
|
|
|
|
); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# Such modules tend to inflict both strictures and warnings, so for |
112
|
|
|
|
|
|
|
# the moment these equivalent module lists are exactly the same. |
113
|
|
|
|
|
|
|
Readonly::Array our @WARNINGS_EQUIVALENT_MODULES |
114
|
|
|
|
|
|
|
=> @STRICT_EQUIVALENT_MODULES; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
__END__ |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=pod |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=for stopwords |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 NAME |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Perl::ToPerl6::Utils::Constants - Global constants. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 DESCRIPTION |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Defines commonly used constants for L<Perl::ToPerl6|Perl::ToPerl6>. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
This is considered to be a public module. Any changes to its |
140
|
|
|
|
|
|
|
interface will go through a deprecation cycle. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 IMPORTABLE CONSTANTS |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=over |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item C<$PROFILE_STRICTNESS_WARN> |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=item C<$PROFILE_STRICTNESS_FATAL> |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item C<$PROFILE_STRICTNESS_QUIET> |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item C<$PROFILE_STRICTNESS_DEFAULT> |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item C<%PROFILE_STRICTNESSES> |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Valid values for the L<perlmogrify/"-profile-strictness"> option. |
158
|
|
|
|
|
|
|
Determines whether recoverable problems found in a profile file appear |
159
|
|
|
|
|
|
|
as warnings, are fatal, or are ignored. |
160
|
|
|
|
|
|
|
C<$PROFILE_STRICTNESS_DEFAULT> is set to C<$PROFILE_STRICTNESS_WARN>. |
161
|
|
|
|
|
|
|
Importable via the C<:profile_strictness> tag. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item C<$PROFILE_COLOR_NECESSITY_HIGHEST_DEFAULT> |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Default for the -color-necessity-highest option. Importable via the |
167
|
|
|
|
|
|
|
C<:color_necessity> tag. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item C<$PROFILE_COLOR_NECESSITY_HIGH_DEFAULT> |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Default for the -color-necessity-high option. Importable via the |
172
|
|
|
|
|
|
|
C<:color_necessity> tag. |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=item C<$PROFILE_COLOR_NECESSITY_MEDIUM_DEFAULT> |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
Default for the -color-necessity-medium option. Importable via the |
177
|
|
|
|
|
|
|
C<:color_necessity> tag. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item C<$PROFILE_COLOR_NECESSITY_LOW_DEFAULT> |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Default for the -color-necessity-low option. Importable via the |
182
|
|
|
|
|
|
|
C<:color_necessity> tag. |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item C<$PROFILE_COLOR_NECESSITY_LOWEST_DEFAULT> |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Default for the -color-necessity-lowest option. Importable via the |
187
|
|
|
|
|
|
|
C<:color_necessity> tag. |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=item C<@STRICT_EQUIVALENT_MODULES> |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item C<@WARNINGS_EQUIVALENT_MODULES> |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
As the names suggest, these are lists of modules that are equivalent to |
194
|
|
|
|
|
|
|
applying the L<strict|strict> or L<warnings|warnings> pragma when loaded. At |
195
|
|
|
|
|
|
|
the moment, both lists are exactly the same. B<Note:> These lists are not |
196
|
|
|
|
|
|
|
exhaustive; they only include the most commonly used modules. Transformers that |
197
|
|
|
|
|
|
|
use these lists should permit configuration of additional modules. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=back |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 AUTHOR |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=head1 COPYRIGHT |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
Copyright (c) 2007-2011 Elliot Shank. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
212
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
213
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=cut |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
# Local Variables: |
218
|
|
|
|
|
|
|
# mode: cperl |
219
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
220
|
|
|
|
|
|
|
# fill-column: 78 |
221
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
222
|
|
|
|
|
|
|
# c-indentation-style: bsd |
223
|
|
|
|
|
|
|
# End: |
224
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |