line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tree::Object::Array; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2016-03-30'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.06'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
20924
|
use 5.010001; |
|
1
|
|
|
|
|
3
|
|
7
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
8
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
133
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1
|
|
|
1
|
|
6
|
my ($class0, @attrs) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
3
|
my $caller = caller(); |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
13
|
my $code_str = "package $caller;\n"; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
|
|
1
|
$code_str .= "use Class::Accessor::Array {\n"; |
18
|
1
|
|
|
|
|
1
|
$code_str .= " accessors => {\n"; |
19
|
1
|
|
|
|
|
1
|
my $idx = 0; |
20
|
1
|
|
|
|
|
2
|
for (@attrs, "parent", "children") { |
21
|
3
|
|
|
|
|
5
|
$code_str .= " '$_' => $idx,\n"; |
22
|
3
|
|
|
|
|
3
|
$idx++; |
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
|
|
1
|
$code_str .= " },\n"; |
25
|
1
|
|
|
|
|
2
|
$code_str .= "};\n"; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
1
|
$code_str .= "use Role::Tiny::With;\n"; |
28
|
1
|
|
|
|
|
1
|
$code_str .= "with 'Role::TinyCommons::Tree::NodeMethods';\n"; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#say $code_str; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
155
|
eval $code_str; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
59
|
|
33
|
1
|
50
|
|
|
|
734
|
die if $@; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
# ABSTRACT: An array-based tree object |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |