line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dallycot::AST::LibraryFunction; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:JSMITH'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# ABSTRACT: Call function in an extension library |
5
|
|
|
|
|
|
|
|
6
|
23
|
|
|
23
|
|
15623
|
use strict; |
|
23
|
|
|
|
|
37
|
|
|
23
|
|
|
|
|
681
|
|
7
|
23
|
|
|
23
|
|
87
|
use warnings; |
|
23
|
|
|
|
|
37
|
|
|
23
|
|
|
|
|
445
|
|
8
|
|
|
|
|
|
|
|
9
|
23
|
|
|
23
|
|
79
|
use utf8; |
|
23
|
|
|
|
|
29
|
|
|
23
|
|
|
|
|
89
|
|
10
|
23
|
|
|
23
|
|
504
|
use parent 'Dallycot::AST'; |
|
23
|
|
|
|
|
34
|
|
|
23
|
|
|
|
|
98
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub to_string { |
13
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my ( $parsing_library, $fname, $bindings, $options ) = @$self; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return join( ",", |
18
|
|
|
|
|
|
|
"call($parsing_library#$fname", |
19
|
0
|
|
|
|
|
|
( map { $_->to_string } @$bindings ), |
20
|
0
|
|
|
|
|
|
( map { $_ . "->" . $options->{$_}->to_string } keys %$options ) ) |
21
|
|
|
|
|
|
|
. ")"; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub execute { |
25
|
0
|
|
|
0
|
0
|
|
my ( $self, $engine ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my ( $parsing_library, $fname, $bindings, $options ) = @$self; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
return $parsing_library->instance->call_function( $fname, $engine, $options, @{$bindings} ); |
|
0
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub child_nodes { |
33
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return ( @{ $self->[2] }, values %{ $self->[3] } ); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |