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

filter: Statementstmt 100% 10 / 10 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 100% 16 / 16 CC 2 SCAR 5.1
CC
2
Cov
100%
print
2.0
BEGIN
1.0
CRAP 1.7
« blib/lib/Erlang/Parser/Node/Literal.pm ↑ Summary blib/lib/Erlang/Parser/Node/UnOp.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::Macro;
6  
7 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 with 'Erlang::Parser::Node';
9  
10 3 has 'macro' => (is => 'rw', required => 1, isa => 'Str');
11  
12 1420 ▶sub print {
Subroutine print: called CC=2 SCAR=6.9
Pod documented
13 1420 my ($self, $fh, $depth) = @_;
14 1420 ▶ $depth ||= 0;
Condition100%2/2
$depth ||= 0
l!l
139624
MC/DC100%1/1
$depth ||= 0
$depth
Truth table100%2/2
A
A= $depth
Aresult
11
00
15  
16 1420 print $fh '?', $self->macro;
17 }
18  
19 3 __PACKAGE__->meta->make_immutable;
20  
21 =head1 NAME
22  
23 Erlang::Parser::Node::Macro - a preprocessor-style macro
24  
25 =head1 DESCRIPTION
26  
27 Defined with the -define() directive; expands as any node.
28  
29 =head2 Accessors
30  
31 =over 4
32  
33 =item C<macro>
34  
35 The name of the macro being invoked.
36  
37 =back
38  
39 =head2 Methods
40  
41 =over 4
42  
43 =item C<print>
44  
45 Pretty-prints the node to its filehandle argument.
46  
47 =back
48  
49 =head1 EXAMPLE
50  
51 ?MODULE
52  
53 =cut
54  
55 3 1;
56  
57 # vim: set sw=4 ts=4:
« blib/lib/Erlang/Parser/Node/Literal.pm ↑ Summary blib/lib/Erlang/Parser/Node/UnOp.pm »