blib/lib/Zuzu/AST/Stmt/PostfixIf.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 89.4% 17 / 19 CC 1 SCAR 0.3
CC
1
Cov
93%
__ANON__
1.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Zuzu/AST/Stmt/Try.pm ↑ Summary blib/lib/Zuzu/AST/Stmt/For.pm »
1 package Zuzu::AST::Stmt::PostfixIf;
2  
3 78 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 78 our $VERSION = '0.007002';
6  
7 78 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 78 has 'statement' => ( is => 'rw' );
10 78 has 'cond' => ( is => 'rw' );
11 0 ▶has 'negate' => ( is => 'rw', default => sub { 0 } );
Subroutine __ANON__: not called CC=1 SCAR=1.2
12  
13 78 with 'Zuzu::AST::Role::Node';
14  
15 1516 ▶sub evaluate { $_[1]->eval_postfix_if($_[0]) }
Subroutine evaluate: called CC=1 SCAR=0.0
Pod documented
16  
17 =pod
18  
19 =head1 NAME
20  
21 Zuzu::AST::Stmt::PostfixIf - AST node for postfix conditional statements
22  
23 =head1 DESCRIPTION
24  
25 Represents one statement form in the abstract syntax tree and
26 delegates execution to C<Zuzu::Runtime>.
27  
28 =head1 INHERITANCE
29  
30 Inherits from C<Moo::Object>.
31  
32 =head1 ROLES
33  
34 Consumes C<Zuzu::AST::Role::Node>.
35  
36 =head1 ATTRIBUTES
37  
38 =head2 statement
39  
40 Type: B<ConsumerOf["Zuzu::AST::Role::Node"]>.
41  
42 Wrapped statement that is conditionally executed.
43  
44 =head2 cond
45  
46 Type: B<ConsumerOf["Zuzu::AST::Role::Node"]>.
47  
48 Condition expression.
49  
50 =head2 negate
51  
52 Type: B<Bool>.
53  
54 True when this node represents postfix C<unless>; false for postfix
55 C<if>.
56  
57 =head1 METHODS
58  
59 =head2 evaluate
60  
61 Dispatches this AST node to the matching runtime evaluator.
62  
63 =head1 SEE ALSO
64  
65 C<Zuzu::AST::Role::Node>.
66  
67 Subclasses: none in this distribution.
68  
69 =head1 COPYRIGHT AND LICENCE
70  
71 B<< Zuzu::AST::Stmt::PostfixIf >> is copyright Toby Inkster.
72  
73 It is free software; you may redistribute it and/or modify it under
74 the terms of either the Artistic License 1.0 or the GNU General Public
75 License version 2.
76  
77 =cut
78  
79 78 1;
« blib/lib/Zuzu/AST/Stmt/Try.pm ↑ Summary blib/lib/Zuzu/AST/Stmt/For.pm »