blib/lib/Zuzu/AST/Expr/Slice.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/Set.pm ↑ Summary blib/lib/Zuzu/AST/Expr/Ternary.pm »
1 package Zuzu::AST::Expr::Slice;
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 'collection' => ( is => 'rw' );
10 78 has 'start' => ( is => 'rw' );
11 78 has 'length' => ( is => 'rw' );
12  
13 78 with 'Zuzu::AST::Role::Node';
14  
15 7 ▶sub evaluate { $_[1]->eval_slice($_[0]) }
Subroutine evaluate: called CC=1 SCAR=0.0
Pod documented
16  
17 =pod
18  
19 =head1 NAME
20  
21 Zuzu::AST::Expr::Slice - AST node for slice expressions
22  
23 =head1 DESCRIPTION
24  
25 Represents one expression form in the abstract syntax tree and delegates evaluation to C<Zuzu::Runtime>.
26  
27 =head1 INHERITANCE
28  
29 Inherits from C<Moo::Object>.
30  
31 =head1 ROLES
32  
33 Consumes C<Zuzu::AST::Role::Node>.
34  
35 =head1 ATTRIBUTES
36  
37 =head2 collection
38  
39 Type: B<ConsumerOf["Zuzu::AST::Role::Node"]>.
40  
41 Expression that yields the value being sliced.
42  
43 =head2 start
44  
45 Type: B<Maybe[ConsumerOf["Zuzu::AST::Role::Node"]]>.
46  
47 Optional expression for the starting index.
48  
49 =head2 length
50  
51 Type: B<Maybe[ConsumerOf["Zuzu::AST::Role::Node"]]>.
52  
53 Optional expression for the slice length.
54  
55 =head1 METHODS
56  
57 =head2 evaluate
58  
59 Dispatches this AST node to the matching runtime evaluator.
60  
61 =head1 SEE ALSO
62  
63 C<Zuzu::AST::Role::Node>.
64  
65 Subclasses: none in this distribution.
66  
67 =head1 COPYRIGHT AND LICENCE
68  
69 B<< Zuzu::AST::Expr::Slice >> is copyright Toby Inkster.
70  
71 It is free software; you may redistribute it and/or modify it under
72 the terms of either the Artistic License 1.0 or the GNU General Public
73 License version 2.
74  
75 =cut
76  
77 78 1;
« blib/lib/Zuzu/AST/Expr/Set.pm ↑ Summary blib/lib/Zuzu/AST/Expr/Ternary.pm »