line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OPTiMaDe::Filter; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
80126
|
use strict; |
|
3
|
|
|
|
|
27
|
|
|
3
|
|
|
|
|
87
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
85
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
14
|
use Scalar::Util qw(blessed); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
503
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.7.3'; # VERSION |
9
|
|
|
|
|
|
|
our $OPTiMaDe_VERSION = '1.0.0-rc.1'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: OPTiMaDe filter language parser/composer |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub modify |
14
|
|
|
|
|
|
|
{ |
15
|
25
|
|
|
25
|
0
|
705
|
my $node = shift; |
16
|
25
|
|
|
|
|
33
|
my $code = shift; |
17
|
|
|
|
|
|
|
|
18
|
25
|
100
|
66
|
|
|
129
|
if( blessed $node && $node->can( 'modify' ) ) { |
|
|
50
|
|
|
|
|
|
19
|
10
|
|
|
|
|
50
|
return $node->modify( $code, @_ ); |
20
|
|
|
|
|
|
|
} elsif( ref $node eq 'ARRAY' ) { |
21
|
0
|
|
|
|
|
0
|
return [ map { modify( $_, $code, @_ ) } @$node ]; |
|
0
|
|
|
|
|
0
|
|
22
|
|
|
|
|
|
|
} else { |
23
|
15
|
|
|
|
|
30
|
return $code->( $node, @_ ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |