« blib/lib/Erlang/Parser/Node/Variable.pm
↑ Summary
blib/lib/Erlang/Parser/Node/VariableRecordUpdate.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::VariableRecordAccess; | ||||||||||||
| 6 | |||||||||||||
| 7 | 3 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 3 | with 'Erlang::Parser::Node'; | |||||||||||
| 9 | |||||||||||||
| 10 | 3 | has 'variable' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node::Variable'); | |||||||||||
| 11 | 3 | has 'record' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node::Atom'); | |||||||||||
| 12 | |||||||||||||
| 13 | 72 | ▶ | sub print { | ||||||||||
|
Subroutine
print: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 14 | 72 | my ($self, $fh, $depth) = @_; | |||||||||||
| 15 | 72 | ▶ | $depth ||= 0; | ||||||||||
|
Condition100%2/2
$depth ||= 0
MC/DC100%1/1
$depth ||= 0
$depth
Truth table100%2/2
A
A= $depth
| |||||||||||||
| 16 | |||||||||||||
| 17 | 72 | $self->variable->print($fh, $depth); | |||||||||||
| 18 | 72 | print $fh '#'; | |||||||||||
| 19 | 72 | $self->record->print($fh, $depth); | |||||||||||
| 20 | } | ||||||||||||
| 21 | |||||||||||||
| 22 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||||
| 23 | |||||||||||||
| 24 | =head1 NAME | ||||||||||||
| 25 | |||||||||||||
| 26 | Erlang::Parser::Node::VariableRecordAccess - variable record access | ||||||||||||
| 27 | |||||||||||||
| 28 | =head1 DESCRIPTION | ||||||||||||
| 29 | |||||||||||||
| 30 | An access of a variable record's component. | ||||||||||||
| 31 | |||||||||||||
| 32 | =head2 Accessors | ||||||||||||
| 33 | |||||||||||||
| 34 | =over 4 | ||||||||||||
| 35 | |||||||||||||
| 36 | =item C<variable> | ||||||||||||
| 37 | |||||||||||||
| 38 | The L<Erlang::Parser::Node::Variable> which is being accessed. | ||||||||||||
| 39 | |||||||||||||
| 40 | =item C<record> | ||||||||||||
| 41 | |||||||||||||
| 42 | An L<Erlang::Parser::Node::Atom> which defines the record and (!) the record | ||||||||||||
| 43 | part. (TODO) | ||||||||||||
| 44 | |||||||||||||
| 45 | =back | ||||||||||||
| 46 | |||||||||||||
| 47 | =head2 Methods | ||||||||||||
| 48 | |||||||||||||
| 49 | =over 4 | ||||||||||||
| 50 | |||||||||||||
| 51 | =item C<print> | ||||||||||||
| 52 | |||||||||||||
| 53 | Pretty-prints the node to its filehandle argument. | ||||||||||||
| 54 | |||||||||||||
| 55 | =back | ||||||||||||
| 56 | |||||||||||||
| 57 | =head1 EXAMPLE | ||||||||||||
| 58 | |||||||||||||
| 59 | MyVar#state.part | ||||||||||||
| 60 | |||||||||||||
| 61 | =cut | ||||||||||||
| 62 | |||||||||||||
| 63 | 3 | 1; | |||||||||||
| 64 | |||||||||||||
| 65 | # vim: set sw=4 ts=4: | ||||||||||||