line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Amuse::String; |
2
|
21
|
|
|
21
|
|
178
|
use strict; |
|
21
|
|
|
|
|
62
|
|
|
21
|
|
|
|
|
659
|
|
3
|
21
|
|
|
21
|
|
126
|
use warnings; |
|
21
|
|
|
|
|
50
|
|
|
21
|
|
|
|
|
559
|
|
4
|
21
|
|
|
21
|
|
105
|
use utf8; |
|
21
|
|
|
|
|
47
|
|
|
21
|
|
|
|
|
129
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Text::Amuse::String - Process one-line muse strings. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
This module provides a minimal class compatible with |
13
|
|
|
|
|
|
|
Text::Amuse::Document to process single strings passed via value. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 CONSTRUCTORS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=over 4 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=item new ($string) |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Constructor |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
30
|
|
|
30
|
1
|
140
|
my ($class, $string, $lang) = @_; |
27
|
30
|
|
100
|
|
|
141
|
my $self = { |
28
|
|
|
|
|
|
|
_raw_string => $string, |
29
|
|
|
|
|
|
|
_lang => $lang || 'en', |
30
|
|
|
|
|
|
|
}; |
31
|
30
|
|
|
|
|
55
|
bless $self, $class; |
32
|
30
|
|
|
|
|
74
|
return $self; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=back |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over 4 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item string |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The string stored |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub string { |
48
|
30
|
|
|
30
|
1
|
117
|
return shift->{_raw_string}; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item elements |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
It returns the only L which composes the body. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub elements { |
59
|
30
|
|
|
30
|
1
|
49
|
my $self = shift; |
60
|
30
|
|
|
|
|
63
|
my $el = Text::Amuse::Element->new(type => 'standalone', |
61
|
|
|
|
|
|
|
string => $self->string); |
62
|
30
|
|
|
|
|
75
|
return ($el); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 Fake methods |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
They return nothing, but nevertheless the Output module won't complain. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over 4 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item raw_header |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item get_footnote |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item attachments |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item language_code |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item set_bidi_document |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item set_has_ruby |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=back |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub raw_header { |
91
|
0
|
|
|
0
|
1
|
0
|
return; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub get_footnote { |
95
|
8
|
|
|
8
|
1
|
25
|
return; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub attachments { |
99
|
0
|
|
|
0
|
1
|
0
|
return; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub language_code { |
103
|
30
|
|
|
30
|
1
|
79
|
shift->{_lang}; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub set_bidi_document { |
107
|
4
|
|
|
4
|
1
|
9
|
return; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub set_has_ruby { |
111
|
1
|
|
|
1
|
1
|
12
|
return; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
1; |