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

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.0
« blib/lib/Zuzu/AST/Role/Node.pm ↑ Summary blib/lib/Zuzu/AST/Stmt/Class.pm »
1 package Zuzu::AST::Stmt::Assign;
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 'target' => ( is => 'rw' );
10 78 has 'op' => ( is => 'rw' );
11 78 has 'expr' => ( is => 'rw' );
12 78 has 'match_expr' => ( is => 'rw' );
13 78 has 'replace_expr' => ( is => 'rw' );
14 18 ▶has 'is_weak_write' => ( is => 'rw', default => sub { 0 } );
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 78 with 'Zuzu::AST::Role::Node';
17  
18 24238 ▶sub evaluate { $_[1]->eval_assign($_[0]) }
Subroutine evaluate: called CC=1 SCAR=0.0
Pod documented
19  
20 =pod
21  
22 =head1 NAME
23  
24 Zuzu::AST::Stmt::Assign - AST node for assign statements
25  
26 =head1 DESCRIPTION
27  
28 Represents one statement form in the abstract syntax tree and delegates execution to C<Zuzu::Runtime>.
29  
30 =head1 INHERITANCE
31  
32 Inherits from C<Moo::Object>.
33  
34 =head1 ROLES
35  
36 Consumes C<Zuzu::AST::Role::Node>.
37  
38 =head1 ATTRIBUTES
39  
40 =head2 target
41  
42 Type: B<ConsumerOf["Zuzu::AST::Role::Node"]>.
43  
44 Assignment target expression (usually a variable).
45  
46 =head2 op
47  
48 Type: B<Str>.
49  
50 Operator symbol used by this AST node.
51  
52 =head2 expr
53  
54 Type: B<Maybe[ConsumerOf["Zuzu::AST::Role::Node"]]>.
55  
56 Expression child evaluated by this node.
57  
58 =head1 METHODS
59  
60 =head2 evaluate
61  
62 Dispatches this AST node to the matching runtime evaluator.
63  
64 =head1 SEE ALSO
65  
66 C<Zuzu::AST::Role::Node>.
67  
68 Subclasses: none in this distribution.
69  
70 =head1 COPYRIGHT AND LICENCE
71  
72 B<< Zuzu::AST::Stmt::Assign >> is copyright Toby Inkster.
73  
74 It is free software; you may redistribute it and/or modify it under
75 the terms of either the Artistic License 1.0 or the GNU General Public
76 License version 2.
77  
78 =cut
79  
80 78 1;
« blib/lib/Zuzu/AST/Role/Node.pm ↑ Summary blib/lib/Zuzu/AST/Stmt/Class.pm »