line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OPTiMaDe::Filter; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
71730
|
use strict; |
|
3
|
|
|
|
|
41
|
|
|
3
|
|
|
|
|
90
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
87
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
13
|
use Scalar::Util qw(blessed); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
436
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.7.2'; # 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
|
571
|
my $node = shift; |
16
|
25
|
|
|
|
|
28
|
my $code = shift; |
17
|
|
|
|
|
|
|
|
18
|
25
|
100
|
66
|
|
|
135
|
if( blessed $node && $node->can( 'modify' ) ) { |
|
|
50
|
|
|
|
|
|
19
|
10
|
|
|
|
|
31
|
return $node->modify( $code, @_ ); |
20
|
|
|
|
|
|
|
} elsif( ref $node eq 'ARRAY' ) { |
21
|
0
|
|
|
|
|
0
|
return [ map { modify( $_, $code, @_ ) } @$node ]; |
|
0
|
|
|
|
|
0
|
|
22
|
|
|
|
|
|
|
} else { |
23
|
15
|
|
|
|
|
32
|
return $code->( $node, @_ ); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |