line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright 2011-2012 Yuki Izumi. ( anneli AT cpan DOT org ) |
2
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the |
3
|
|
|
|
|
|
|
# same terms as Perl itself. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Erlang::Parser::Node::Call; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
12
|
use Moose; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
13
|
|
8
|
|
|
|
|
|
|
with 'Erlang::Parser::Node'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'module' => (is => 'rw', required => 0, isa => 'Erlang::Parser::Node'); |
11
|
|
|
|
|
|
|
has 'function' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node'); |
12
|
|
|
|
|
|
|
has 'args' => (is => 'rw', required => 1, isa => 'ArrayRef[Erlang::Parser::Node]'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub print { |
15
|
6828
|
|
|
6828
|
1
|
6294
|
my ($self, $fh, $depth) = @_; |
16
|
6828
|
|
100
|
|
|
8714
|
$depth ||= 0; |
17
|
|
|
|
|
|
|
|
18
|
6828
|
100
|
|
|
|
156956
|
if (defined $self->module) { |
19
|
1802
|
|
|
|
|
40233
|
$self->module->print($fh, $depth); |
20
|
1802
|
|
|
|
|
2184
|
print $fh ':'; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
6828
|
100
|
|
|
|
155887
|
print $fh '(' if $self->function->blessed ne 'Erlang::Parser::Node::Atom'; |
24
|
6828
|
|
|
|
|
154957
|
$self->function->print($fh, $depth); |
25
|
6828
|
100
|
|
|
|
156567
|
print $fh ')' if $self->function->blessed ne 'Erlang::Parser::Node::Atom'; |
26
|
6828
|
|
|
|
|
7800
|
print $fh '('; |
27
|
6828
|
|
|
|
|
5204
|
my $first = 1; |
28
|
6828
|
|
|
|
|
6418
|
foreach (@{$self->args}) { |
|
6828
|
|
|
|
|
155901
|
|
29
|
11272
|
100
|
|
|
|
13257
|
if ($first) { $first = 0 } else { print $fh ', ' } |
|
6678
|
|
|
|
|
5371
|
|
|
4594
|
|
|
|
|
4771
|
|
30
|
11272
|
|
|
|
|
24006
|
$_->print($fh, $depth); |
31
|
|
|
|
|
|
|
} |
32
|
6828
|
|
|
|
|
12091
|
print $fh ')'; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Erlang::Parser::Node::Call - a function call |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
A call to a function, either local or external. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 Accessors |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=over 4 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item C<module> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
A L<Erlang::Parser::Node> which returns the name of the module to use as an |
52
|
|
|
|
|
|
|
atom; or C<undef>. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item C<function> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
A L<Erlang::Parser::Node> which either returns an atom which corresponds to a |
57
|
|
|
|
|
|
|
local function or a function in C<module> if specified; or which returns a |
58
|
|
|
|
|
|
|
calculated fun or fun reference itself. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item C<args> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
A list of L<Erlang::Parser::Node>s which are passed as arguments to the |
63
|
|
|
|
|
|
|
function. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 Methods |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=over 4 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item C<print> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Pretty-prints the node to its filehandle argument. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 EXAMPLE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
lists:reverse([1, 2, 3]) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# vim: set sw=4 ts=4: |