line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YAML::LibYAML::API::YPP::Parser; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
10
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
433
|
use YAML::LibYAML::API::Parser; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
6
|
1
|
|
|
1
|
|
6
|
use Scalar::Util qw/ openhandle /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
7
|
1
|
|
|
1
|
|
6
|
use base 'YAML::PP::Parser'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
104
|
|
8
|
1
|
|
|
1
|
|
16
|
use Carp qw/ croak /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
202
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub parse { |
11
|
3
|
|
|
3
|
0
|
2193
|
my ($self) = @_; |
12
|
3
|
|
|
|
|
20
|
my $reader = $self->reader; |
13
|
3
|
|
|
|
|
82
|
my $parser = YAML::LibYAML::API::Parser->new; |
14
|
3
|
100
|
|
|
|
34
|
if ($reader->can('open_handle')) { |
15
|
2
|
100
|
|
|
|
7
|
if (openhandle($reader->input)) { |
16
|
1
|
|
|
|
|
12
|
$parser->set_input_filehandle($reader->input); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
1
|
|
|
|
|
233
|
croak "Currently parsing a file is not supported, see documentation of YAML::LibYAML::API::Parser"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
else { |
23
|
1
|
|
|
|
|
5
|
my $yaml = $reader->read; |
24
|
1
|
|
|
|
|
24
|
$parser->set_input_string($yaml); |
25
|
|
|
|
|
|
|
} |
26
|
2
|
|
|
|
|
106
|
while (my $event = $parser->parse) { |
27
|
32
|
|
|
|
|
2299
|
$self->callback->( $self, $event->{name} => $event ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |