blib/lib/Zuzu/AST/Expr/IncDec.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
evaluate
1.0
CRAP 1.0
« blib/lib/Zuzu/AST/Expr/DictGet.pm ↑ Summary blib/lib/Zuzu/AST/Expr/Index.pm »
1 package Zuzu::AST::Expr::IncDec;
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 'op' => ( is => 'rw' );
10 78 has 'target' => ( is => 'rw' );
11 78 has 'postfix' => ( is => 'rw' );
12  
13 78 with 'Zuzu::AST::Role::Node';
14  
15 22495 ▶sub evaluate { $_[1]->eval_incdec($_[0]) }
Subroutine evaluate: called CC=1 SCAR=0.0
Pod documented
16  
17 =pod
18  
19 =head1 NAME
20  
21 Zuzu::AST::Expr::IncDec - AST node for increment/decrement expressions
22  
23 =head1 DESCRIPTION
24  
25 Represents one expression form in the abstract syntax tree and
26 delegates evaluation 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 op
39  
40 Type: B<Str>.
41  
42 Operator symbol, either C<++> or C<-->.
43  
44 =head2 target
45  
46 Type: B<ConsumerOf["Zuzu::AST::Role::Node"]>.
47  
48 Lvalue target expression to mutate.
49  
50 =head2 postfix
51  
52 Type: B<Bool>.
53  
54 True for postfix form (C<x++> / C<x-->), false for prefix form
55 (C<++x> / C<--x>).
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::Expr::IncDec >> 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/Expr/DictGet.pm ↑ Summary blib/lib/Zuzu/AST/Expr/Index.pm »