File Coverage

blib/lib/Erlang/Parser/Node/VariableRecordAccess.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition 2 2 100.0
subroutine 2 2 100.0
pod 1 1 100.0
total 13 13 100.0


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::VariableRecordAccess;
6              
7 3     3   13 use Moose;
  3         5  
  3         16  
8             with 'Erlang::Parser::Node';
9              
10             has 'variable' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node::Variable');
11             has 'record' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node::Atom');
12              
13             sub print {
14 72     72 1 89 my ($self, $fh, $depth) = @_;
15 72   100     163 $depth ||= 0;
16              
17 72         2087 $self->variable->print($fh, $depth);
18 72         96 print $fh '#';
19 72         1950 $self->record->print($fh, $depth);
20             }
21              
22             __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             1;
64              
65             # vim: set sw=4 ts=4: