line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::TransformerParameter::Behavior::Boolean; |
2
|
|
|
|
|
|
|
|
3
|
23
|
|
|
23
|
|
368
|
use 5.006001; |
|
23
|
|
|
|
|
62
|
|
4
|
23
|
|
|
23
|
|
99
|
use strict; |
|
23
|
|
|
|
|
39
|
|
|
23
|
|
|
|
|
450
|
|
5
|
23
|
|
|
23
|
|
84
|
use warnings; |
|
23
|
|
|
|
|
35
|
|
|
23
|
|
|
|
|
511
|
|
6
|
23
|
|
|
23
|
|
88
|
use Perl::ToPerl6::Utils; |
|
23
|
|
|
|
|
38
|
|
|
23
|
|
|
|
|
359
|
|
7
|
|
|
|
|
|
|
|
8
|
23
|
|
|
23
|
|
15688
|
use base qw{ Perl::ToPerl6::TransformerParameter::Behavior }; |
|
23
|
|
|
|
|
33
|
|
|
23
|
|
|
|
|
4762
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _parse { |
15
|
9
|
|
|
9
|
|
14
|
my ($transformer, $parameter, $config_string) = @_; |
16
|
|
|
|
|
|
|
|
17
|
9
|
|
|
|
|
8
|
my $value; |
18
|
9
|
|
|
|
|
29
|
my $value_string = $parameter->get_default_string(); |
19
|
|
|
|
|
|
|
|
20
|
9
|
100
|
|
|
|
21
|
if (defined $config_string) { |
21
|
6
|
|
|
|
|
8
|
$value_string = $config_string; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
9
|
100
|
|
|
|
23
|
if ( $value_string ) { |
25
|
4
|
|
|
|
|
7
|
$value = $TRUE; |
26
|
|
|
|
|
|
|
} else { |
27
|
5
|
|
|
|
|
7
|
$value = $FALSE; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
9
|
|
|
|
|
27
|
$transformer->__set_parameter_value($parameter, $value); |
31
|
|
|
|
|
|
|
|
32
|
9
|
|
|
|
|
18
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub initialize_parameter { |
38
|
3
|
|
|
3
|
1
|
7
|
my ($self, $parameter, $specification) = @_; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
|
|
15
|
$parameter->_set_parser(\&_parse); |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
6
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=for stopwords |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Perl::ToPerl6::TransformerParameter::Behavior::Boolean - Actions appropriate for a boolean parameter. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Provides a standard set of functionality for a boolean |
65
|
|
|
|
|
|
|
L<Perl::ToPerl6::TransformerParameter|Perl::ToPerl6::TransformerParameter> so that |
66
|
|
|
|
|
|
|
the developer of a transformer does not have to provide it her/himself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
NOTE: Do not instantiate this class. Use the singleton instance held |
69
|
|
|
|
|
|
|
onto by |
70
|
|
|
|
|
|
|
L<Perl::ToPerl6::TransformerParameter|Perl::ToPerl6::TransformerParameter>. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This is considered to be a non-public class. Its interface is subject |
76
|
|
|
|
|
|
|
to change without notice. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 METHODS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=over |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item C<initialize_parameter( $parameter, $specification )> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Plug in the functionality this behavior provides into the parameter. |
86
|
|
|
|
|
|
|
At present, this behavior isn't customizable by the specification. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=back |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 AUTHOR |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 COPYRIGHT |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Copyright (c) 2006-2011 Elliot Shank. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
102
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
103
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# Local Variables: |
108
|
|
|
|
|
|
|
# mode: cperl |
109
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
110
|
|
|
|
|
|
|
# fill-column: 78 |
111
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
112
|
|
|
|
|
|
|
# c-indentation-style: bsd |
113
|
|
|
|
|
|
|
# End: |
114
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |