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