line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tree::Object::Array; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
78559
|
use 5.010001; |
|
1
|
|
|
|
|
12
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
241
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY |
8
|
|
|
|
|
|
|
our $DATE = '2021-10-07'; # DATE |
9
|
|
|
|
|
|
|
our $DIST = 'Tree-Object'; # DIST |
10
|
|
|
|
|
|
|
our $VERSION = '0.080'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
1
|
|
|
1
|
|
10
|
my ($class0, @attrs) = @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
my $caller = caller(); |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
18
|
my $code_str = "package $caller;\n"; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
3
|
$code_str .= "use Class::Accessor::Array {\n"; |
20
|
1
|
|
|
|
|
2
|
$code_str .= " accessors => {\n"; |
21
|
1
|
|
|
|
|
1
|
my $idx = 0; |
22
|
1
|
|
|
|
|
3
|
for (@attrs, "parent", "children") { |
23
|
3
|
|
|
|
|
7
|
$code_str .= " '$_' => $idx,\n"; |
24
|
3
|
|
|
|
|
5
|
$idx++; |
25
|
|
|
|
|
|
|
} |
26
|
1
|
|
|
|
|
2
|
$code_str .= " },\n"; |
27
|
1
|
|
|
|
|
1
|
$code_str .= "};\n"; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
2
|
$code_str .= "use Role::Tiny::With;\n"; |
30
|
1
|
|
|
|
|
4
|
$code_str .= "with 'Role::TinyCommons::Tree::NodeMethods';\n"; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#say $code_str; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
939
|
eval $code_str; ## no critic: BuiltinFunctions::ProhibitStringyEval |
|
1
|
|
|
1
|
|
42
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
1011
|
|
|
1
|
|
|
|
|
5129
|
|
|
1
|
|
|
|
|
44
|
|
|
1
|
|
|
|
|
73
|
|
35
|
1
|
50
|
|
|
|
5788
|
die if $@; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
# ABSTRACT: An array-based tree object |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |