line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Jmespath::ParsedResult; |
2
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
43
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
36
|
|
4
|
2
|
|
|
2
|
|
639
|
use Jmespath::TreeInterpreter; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
285
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
760
|
|
|
760
|
0
|
704
|
my ( $class, $expression, $parsed ) = @_; |
8
|
760
|
|
|
|
|
837
|
my $self = bless {}, $class; |
9
|
760
|
|
|
|
|
1016
|
$self->{expression} = $expression; |
10
|
760
|
|
|
|
|
725
|
$self->{parsed} = $parsed; |
11
|
760
|
|
|
|
|
1589
|
return $self; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub search { |
15
|
760
|
|
|
760
|
0
|
861
|
my ( $self, $data, $options ) = @_; |
16
|
760
|
|
50
|
|
|
2230
|
$options = $options || undef; |
17
|
760
|
|
|
|
|
1755
|
my $interpreter = Jmespath::TreeInterpreter->new($options); |
18
|
760
|
|
|
|
|
1440
|
my $result = $interpreter->visit( $self->{ parsed }, $data ); |
19
|
715
|
|
|
|
|
1595
|
return $result; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _render_dot_file { |
23
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
24
|
0
|
|
|
|
|
|
my $renderer = Jmespath::GraphvizVisitor->new; |
25
|
0
|
|
|
|
|
|
my $contents = Jmespath::Renderer->visit( $self->parsed ); |
26
|
0
|
|
|
|
|
|
return $contents; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# try to emulate __REPR__ |
30
|
|
|
|
|
|
|
sub stringify { |
31
|
0
|
|
|
0
|
0
|
|
return shift->{parsed}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |