| 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
MC/DC100%1/1
$depth ||= 0
$depth
Truth table100%2/2
A
A= $depth
| |||||||||||||
| 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: | ||||||||||||