line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# pyyaml/lib/yaml/events.py |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package YAML::Perl::Events; |
4
|
16
|
|
|
16
|
|
2400
|
use strict; |
|
16
|
|
|
|
|
35
|
|
|
16
|
|
|
|
|
566
|
|
5
|
16
|
|
|
16
|
|
89
|
use warnings; |
|
16
|
|
|
|
|
166
|
|
|
16
|
|
|
|
|
698
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package YAML::Perl::Event; |
8
|
16
|
|
|
16
|
|
1291
|
use YAML::Perl::Base -base; |
|
16
|
|
|
|
|
36
|
|
|
16
|
|
|
|
|
117
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
field 'start_mark'; |
11
|
|
|
|
|
|
|
field 'end_mark'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use overload '""' => sub { |
14
|
136
|
|
|
136
|
|
178
|
my $self = shift; |
15
|
136
|
|
33
|
|
|
312
|
my $class = ref($self) || $self; |
16
|
|
|
|
|
|
|
|
17
|
136
|
|
|
|
|
472
|
my @attributes = grep exists($self->{$_}), |
18
|
|
|
|
|
|
|
qw(anchor tag implicit value); |
19
|
136
|
|
100
|
|
|
809
|
my $arguments = join ', ', map |
20
|
|
|
|
|
|
|
sprintf("%s=%s", $_, ($self->{$_}||'')), @attributes; |
21
|
136
|
|
|
|
|
1300
|
return "$class($arguments)"; |
22
|
16
|
|
|
16
|
|
104
|
}; |
|
16
|
|
|
|
|
43
|
|
|
16
|
|
|
|
|
227
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
package YAML::Perl::Event::Node; |
25
|
16
|
|
|
16
|
|
1368
|
use YAML::Perl::Event -base; |
|
16
|
|
|
|
|
33
|
|
|
16
|
|
|
|
|
187
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
field 'anchor'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
package YAML::Perl::Event::CollectionStart; |
30
|
16
|
|
|
16
|
|
89
|
use YAML::Perl::Event::Node -base; |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
170
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
field 'tag'; |
33
|
|
|
|
|
|
|
# 01:20 < xitology> for sequences and mappings, implicit tag resolution does not |
34
|
|
|
|
|
|
|
# depend on the node style, so a single boolean value is enough |
35
|
|
|
|
|
|
|
# field 'implicit'; |
36
|
|
|
|
|
|
|
# default to 1 makes things easier for now |
37
|
|
|
|
|
|
|
field 'implicit' => 1; |
38
|
|
|
|
|
|
|
field 'flow_style'; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package YAML::Perl::Event::CollectionEnd; |
41
|
16
|
|
|
16
|
|
98
|
use YAML::Perl::Event -base; |
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
101
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Implementations. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package YAML::Perl::Event::StreamStart; |
46
|
16
|
|
|
16
|
|
86
|
use YAML::Perl::Event -base; |
|
16
|
|
|
|
|
34
|
|
|
16
|
|
|
|
|
76
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
field 'encoding'; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
package YAML::Perl::Event::StreamEnd; |
51
|
16
|
|
|
16
|
|
85
|
use YAML::Perl::Event -base; |
|
16
|
|
|
|
|
40
|
|
|
16
|
|
|
|
|
139
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
package YAML::Perl::Event::DocumentStart; |
54
|
16
|
|
|
16
|
|
98
|
use YAML::Perl::Event -base; |
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
118
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
field 'explicit' => 1; # Different default than PyYaml |
57
|
|
|
|
|
|
|
field 'version'; |
58
|
|
|
|
|
|
|
field 'tags'; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
package YAML::Perl::Event::DocumentEnd; |
61
|
16
|
|
|
16
|
|
91
|
use YAML::Perl::Event -base; |
|
16
|
|
|
|
|
237
|
|
|
16
|
|
|
|
|
97
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
field 'explicit'; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
package YAML::Perl::Event::Alias; |
66
|
16
|
|
|
16
|
|
93
|
use YAML::Perl::Event::Node -base; |
|
16
|
|
|
|
|
30
|
|
|
16
|
|
|
|
|
167
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package YAML::Perl::Event::Scalar; |
69
|
16
|
|
|
16
|
|
88
|
use YAML::Perl::Event::Node -base; |
|
16
|
|
|
|
|
32
|
|
|
16
|
|
|
|
|
97
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
field 'tag'; |
72
|
|
|
|
|
|
|
# 01:17 < xitology> while !!str "123" could not be emitted in the plain style |
73
|
|
|
|
|
|
|
# without a tag (123), but could be as ("123") |
74
|
|
|
|
|
|
|
# 01:17 < xitology> in this case, implicit is (False, True) |
75
|
|
|
|
|
|
|
# 01:17 < xitology> another example is !!int "123", which can be emitted as 123, |
76
|
|
|
|
|
|
|
# but not as "123" |
77
|
|
|
|
|
|
|
# 01:17 < xitology> here, implicit is (True, False) |
78
|
|
|
|
|
|
|
# 01:18 < xitology> so implicit[0] is whether the tag of a scalar node could be |
79
|
|
|
|
|
|
|
# omitted when it is emitted in a plain style |
80
|
|
|
|
|
|
|
# 01:18 < xitology> while implicit[1] is whether the tag could be omitted when |
81
|
|
|
|
|
|
|
# the node is emitted in any non-plain style |
82
|
|
|
|
|
|
|
field 'implicit' => [True, True]; |
83
|
|
|
|
|
|
|
field 'value'; |
84
|
|
|
|
|
|
|
field 'style'; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
package YAML::Perl::Event::SequenceStart; |
87
|
16
|
|
|
16
|
|
111
|
use YAML::Perl::Event::CollectionStart -base; |
|
16
|
|
|
|
|
36
|
|
|
16
|
|
|
|
|
204
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
package YAML::Perl::Event::SequenceEnd; |
90
|
16
|
|
|
16
|
|
99
|
use YAML::Perl::Event::CollectionEnd -base; |
|
16
|
|
|
|
|
34
|
|
|
16
|
|
|
|
|
188
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
package YAML::Perl::Event::MappingStart; |
93
|
16
|
|
|
16
|
|
95
|
use YAML::Perl::Event::CollectionStart -base; |
|
16
|
|
|
|
|
28
|
|
|
16
|
|
|
|
|
92
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
package YAML::Perl::Event::MappingEnd; |
96
|
16
|
|
|
16
|
|
89
|
use YAML::Perl::Event::CollectionEnd -base; |
|
16
|
|
|
|
|
37
|
|
|
16
|
|
|
|
|
91
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |