blib/lib/Erlang/Parser/Node/Tuple.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 2 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 100% 26 / 26 CC 4 SCAR 12.2
CC
4
Cov
100%
print
4.0
BEGIN
1.0
CRAP 3.4
« blib/lib/Erlang/Parser/Node/RecordNew.pm ↑ Summary blib/lib/Erlang/Parser/Node/DefList.pm »
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::Tuple;
6  
7 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 with 'Erlang::Parser::Node';
9  
10 4 has 'elems' => (is => 'rw', required => 1, isa => 'ArrayRef[Erlang::Parser::Node]');
11  
12 sub print {
13 4126 ▶ my ($self, $fh, $depth) = @_;
Subroutine print: called CC=4 SCAR=13.9
Pod documented
14 4126 ▶ $depth ||= 0;
Condition100%2/2
$depth ||= 0
l!l
3740386
MC/DC100%1/1
$depth ||= 0
$depth
Truth table100%2/2
A
A= $depth
Aresult
11
00
15  
16 4126 print $fh '{';
17 4126 my $first = 1;
18 4126 foreach (@{$self->elems}) {
19 9582 ▶ if ($first) { $first = 0 } else { print $fh ', ' }
Branch: 1 branch
BranchTrueFalseTotal
if ($first) { } 4122 5460 9582
20 9582 $_->print($fh, $depth);
21 }
22  
23 4126 print $fh '}';
24 }
25  
26 4 __PACKAGE__->meta->make_immutable;
27  
28 =head1 NAME
29  
30 Erlang::Parser::Node::Tuple - a tuple of items
31  
32 =head1 DESCRIPTION
33  
34 A set number of items; if you need something with variable length, use lists.
35  
36 =head2 Accessors
37  
38 =over 4
39  
40 =item C<elems>
41  
42 The L<Erlang::Parser::Node>s which make up the tuple's elements.
43  
44 =back
45  
46 =head2 Methods
47  
48 =over 4
49  
50 =item C<print>
51  
52 Pretty-prints the node to its filehandle argument.
53  
54 =back
55  
56 =head1 EXAMPLE
57  
58 {1, 2, 3}
59  
60 =cut
61  
62 4 1;
63  
64 # vim: set sw=4 ts=4:
« blib/lib/Erlang/Parser/Node/RecordNew.pm ↑ Summary blib/lib/Erlang/Parser/Node/DefList.pm »