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