line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tags::Output::PYX; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
132726
|
use base qw(Tags::Output); |
|
13
|
|
|
|
|
109
|
|
|
13
|
|
|
|
|
7298
|
|
4
|
13
|
|
|
13
|
|
367861
|
use strict; |
|
13
|
|
|
|
|
32
|
|
|
13
|
|
|
|
|
256
|
|
5
|
13
|
|
|
13
|
|
62
|
use warnings; |
|
13
|
|
|
|
|
26
|
|
|
13
|
|
|
|
|
345
|
|
6
|
|
|
|
|
|
|
|
7
|
13
|
|
|
13
|
|
67
|
use Error::Pure qw(err); |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
496
|
|
8
|
13
|
|
|
13
|
|
66
|
use Readonly; |
|
13
|
|
|
|
|
23
|
|
|
13
|
|
|
|
|
458
|
|
9
|
13
|
|
|
13
|
|
6551
|
use Tags::Utils qw(encode_newline); |
|
13
|
|
|
|
|
94648
|
|
|
13
|
|
|
|
|
257
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Constants. |
12
|
|
|
|
|
|
|
Readonly::Scalar my $EMPTY_STR => q{}; |
13
|
|
|
|
|
|
|
Readonly::Scalar my $SPACE => q{ }; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = 0.05; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Attributes. |
18
|
|
|
|
|
|
|
sub _put_attribute { |
19
|
9
|
|
|
9
|
|
147
|
my ($self, $attr, $value) = @_; |
20
|
9
|
|
|
|
|
22
|
push @{$self->{'flush_code'}}, "A$attr $value"; |
|
9
|
|
|
|
|
46
|
|
21
|
9
|
|
|
|
|
22
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# Begin of tag. |
25
|
|
|
|
|
|
|
sub _put_begin_of_tag { |
26
|
22
|
|
|
22
|
|
14928
|
my ($self, $tag) = @_; |
27
|
22
|
|
|
|
|
40
|
push @{$self->{'flush_code'}}, "($tag"; |
|
22
|
|
|
|
|
74
|
|
28
|
22
|
|
|
|
|
35
|
unshift @{$self->{'printed_tags'}}, $tag; |
|
22
|
|
|
|
|
52
|
|
29
|
22
|
|
|
|
|
54
|
return; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# CData. |
33
|
|
|
|
|
|
|
sub _put_cdata { |
34
|
1
|
|
|
1
|
|
178
|
my ($self, @cdata) = @_; |
35
|
1
|
|
|
|
|
4
|
$self->_put_data(@cdata); |
36
|
1
|
|
|
|
|
3
|
return; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Comment. |
40
|
|
|
|
|
|
|
sub _put_comment { |
41
|
2
|
|
|
2
|
|
205
|
my ($self, @comments) = @_; |
42
|
|
|
|
|
|
|
$self->_put_data( |
43
|
2
|
|
|
|
|
4
|
map { '' } @comments, |
|
2
|
|
|
|
|
11
|
|
44
|
|
|
|
|
|
|
); |
45
|
2
|
|
|
|
|
7
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Data. |
49
|
|
|
|
|
|
|
sub _put_data { |
50
|
12
|
|
|
12
|
|
98
|
my ($self, @data) = @_; |
51
|
12
|
|
|
|
|
47
|
my $data = join($EMPTY_STR, @data); |
52
|
12
|
|
|
|
|
22
|
push @{$self->{'flush_code'}}, '-'.encode_newline($data); |
|
12
|
|
|
|
|
46
|
|
53
|
12
|
|
|
|
|
158
|
return; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# End of tag. |
57
|
|
|
|
|
|
|
sub _put_end_of_tag { |
58
|
22
|
|
|
22
|
|
2022
|
my ($self, $tag) = @_; |
59
|
22
|
|
|
|
|
34
|
my $printed = shift @{$self->{'printed_tags'}}; |
|
22
|
|
|
|
|
51
|
|
60
|
22
|
100
|
|
|
|
64
|
if ($printed ne $tag) { |
61
|
1
|
|
|
|
|
8
|
err "Ending bad tag: '$tag' in block of tag '$printed'."; |
62
|
|
|
|
|
|
|
} |
63
|
21
|
|
|
|
|
56
|
push @{$self->{'flush_code'}}, ")$tag"; |
|
21
|
|
|
|
|
55
|
|
64
|
21
|
|
|
|
|
49
|
return; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# Instruction. |
68
|
|
|
|
|
|
|
sub _put_instruction { |
69
|
2
|
|
|
2
|
|
231
|
my ($self, $target, $code) = @_; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# Construct instruction line. |
72
|
2
|
|
|
|
|
5
|
my $instruction = '?'.$target; |
73
|
2
|
100
|
|
|
|
6
|
if ($code) { |
74
|
1
|
|
|
|
|
3
|
$instruction .= $SPACE.$code; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# To flush code. |
78
|
2
|
|
|
|
|
4
|
push @{$self->{'flush_code'}}, encode_newline($instruction); |
|
2
|
|
|
|
|
9
|
|
79
|
|
|
|
|
|
|
|
80
|
2
|
|
|
|
|
17
|
return; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Raw data. |
84
|
|
|
|
|
|
|
sub _put_raw { |
85
|
1
|
|
|
1
|
|
198
|
my ($self, @raw_data) = @_; |
86
|
1
|
|
|
|
|
5
|
$self->_put_data(@raw_data); |
87
|
1
|
|
|
|
|
3
|
return; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |