| 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::Binary; | ||||||||||||
| 6 | |||||||||||||
| 7 | 4 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 4 | with 'Erlang::Parser::Node'; | |||||||||||
| 9 | |||||||||||||
| 10 | 4 | has 'bexprs' => (is => 'rw', required => 1, isa => 'ArrayRef[Erlang::Parser::Node::BinaryExpr]'); | |||||||||||
| 11 | |||||||||||||
| 12 | sub print { | ||||||||||||
| 13 | 1950 | ▶ | my ($self, $fh, $depth) = @_; | ||||||||||
|
Subroutine
print: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||
| 14 | 1950 | ▶ | $depth ||= 0; | ||||||||||
|
Condition100%2/2
$depth ||= 0
MC/DC100%1/1
$depth ||= 0
$depth
Truth table100%2/2
A
A= $depth
| |||||||||||||
| 15 | |||||||||||||
| 16 | 1950 | print $fh '<<'; | |||||||||||
| 17 | |||||||||||||
| 18 | 1950 | my $first = 1; | |||||||||||
| 19 | 1950 | foreach (@{$self->bexprs}) { | |||||||||||
| 20 | 3270 | ▶ | if ($first) { $first = 0 } else { print $fh ', ' } | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 3270 | $_->print($fh, $depth); | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 1950 | print $fh '>>'; | |||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||
| 28 | |||||||||||||
| 29 | =head1 NAME | ||||||||||||
| 30 | |||||||||||||
| 31 | Erlang::Parser::Node::Binary - a binary string or list | ||||||||||||
| 32 | |||||||||||||
| 33 | =head1 DESCRIPTION | ||||||||||||
| 34 | |||||||||||||
| 35 | A compactly-stored block of data. | ||||||||||||
| 36 | |||||||||||||
| 37 | =head2 Accessors | ||||||||||||
| 38 | |||||||||||||
| 39 | =over 4 | ||||||||||||
| 40 | |||||||||||||
| 41 | =item C<bexprs> | ||||||||||||
| 42 | |||||||||||||
| 43 | A list of L<Erlang::Parser::BinaryExpr>s; the individual expressions are | ||||||||||||
| 44 | composed to create the binary string or list. | ||||||||||||
| 45 | |||||||||||||
| 46 | =back | ||||||||||||
| 47 | |||||||||||||
| 48 | =head2 Methods | ||||||||||||
| 49 | |||||||||||||
| 50 | =over 4 | ||||||||||||
| 51 | |||||||||||||
| 52 | =item C<print> | ||||||||||||
| 53 | |||||||||||||
| 54 | Pretty-prints the node to its filehandle argument. | ||||||||||||
| 55 | |||||||||||||
| 56 | =back | ||||||||||||
| 57 | |||||||||||||
| 58 | =head1 EXAMPLE | ||||||||||||
| 59 | |||||||||||||
| 60 | <<"abc">> | ||||||||||||
| 61 | |||||||||||||
| 62 | =cut | ||||||||||||
| 63 | |||||||||||||
| 64 | 4 | 1; | |||||||||||
| 65 | |||||||||||||
| 66 | # vim: set sw=4 ts=4: | ||||||||||||