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