line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perinci::Sub::Property::curry; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
9956
|
use 5.010; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
6
|
|
|
|
|
|
|
#use Log::Any '$log'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1751
|
use Perinci::Sub::PropertyUtil qw(declare_property); |
|
1
|
|
|
|
|
1603
|
|
|
1
|
|
|
|
|
824
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.04'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
declare_property( |
13
|
|
|
|
|
|
|
name => 'curry', |
14
|
|
|
|
|
|
|
type => 'function', |
15
|
|
|
|
|
|
|
schema => ['hash*'], |
16
|
|
|
|
|
|
|
wrapper => { |
17
|
|
|
|
|
|
|
meta => { |
18
|
|
|
|
|
|
|
v => 2, |
19
|
|
|
|
|
|
|
prio => 10, |
20
|
|
|
|
|
|
|
convert => 1, |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
handler => sub { |
23
|
6
|
|
|
6
|
|
78318
|
my ($self, %args) = @_; |
24
|
6
|
|
33
|
|
|
73
|
my $v = $args{new} // $args{value} // {}; |
|
|
|
50
|
|
|
|
|
25
|
6
|
|
|
|
|
11
|
my $meta = $args{meta}; |
26
|
|
|
|
|
|
|
|
27
|
6
|
|
|
|
|
24
|
$self->select_section('before_call_arg_validation'); |
28
|
6
|
|
|
|
|
361
|
for my $an (keys %$v) { |
29
|
6
|
|
|
|
|
14
|
my $av = $v->{$an}; |
30
|
6
|
|
|
|
|
113
|
$self->_errif(400, "\"Argument $an has been set by curry\"", |
31
|
|
|
|
|
|
|
'exists($args{\''.$an.'\'})'); |
32
|
6
|
|
|
|
|
599
|
$self->push_lines( |
33
|
|
|
|
|
|
|
'$args{\''.$an.'\'} = '. |
34
|
|
|
|
|
|
|
Perinci::Sub::Wrapper::__squote($av).';'); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
# ABSTRACT: Set arguments for function |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |