line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
35
|
use v5.14; |
|
2
|
|
|
|
|
7
|
|
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
63
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
112
|
|
4
|
2
|
|
|
2
|
|
12
|
no warnings qw(void once uninitialized numeric); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
175
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Moops::Keyword::Library; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.038'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
14
|
use Moo; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
14
|
|
12
|
|
|
|
|
|
|
extends 'Moops::Keyword'; |
13
|
2
|
|
|
2
|
|
3231
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
around generate_package_setup => sub |
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
my $orig = shift; |
18
|
|
|
|
|
|
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return ( |
21
|
|
|
|
|
|
|
$self->$orig(@_), |
22
|
|
|
|
|
|
|
$self->generate_type_library_setup, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub generate_type_library_setup |
27
|
|
|
|
|
|
|
{ |
28
|
2
|
|
|
2
|
|
6
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
6
|
my $use_type_library = "use Type::Library -base"; |
31
|
2
|
50
|
|
|
|
4
|
if (@{ $self->relations->{declares} || [] }) |
|
2
|
50
|
|
|
|
22
|
|
32
|
|
|
|
|
|
|
{ |
33
|
2
|
|
|
|
|
6
|
my @types = @{$self->relations->{declares}}; |
|
2
|
|
|
|
|
10
|
|
34
|
2
|
|
|
|
|
10
|
$use_type_library .= ", -declare => qw(@types)"; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
5
|
my $extends; |
38
|
2
|
50
|
|
|
|
3
|
if (@{ $self->relations->{extends} || [] }) |
|
2
|
50
|
|
|
|
17
|
|
39
|
|
|
|
|
|
|
{ |
40
|
2
|
|
|
|
|
4
|
my @parents = @{$self->relations->{extends}}; |
|
2
|
|
|
|
|
9
|
|
41
|
2
|
|
|
|
|
8
|
$extends = "BEGIN { extends qw(@parents) }"; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
return ( |
45
|
2
|
50
|
|
|
|
55
|
"$use_type_library;", |
46
|
|
|
|
|
|
|
"use Type::Utils -all;", |
47
|
|
|
|
|
|
|
($extends ? "$extends;" : ()), |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub known_relationships |
52
|
|
|
|
|
|
|
{ |
53
|
4
|
|
|
4
|
|
99
|
return qw/ extends declares /; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub qualify_relationship |
57
|
|
|
|
|
|
|
{ |
58
|
0
|
|
|
0
|
|
0
|
$_[1] eq 'extends'; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub version_relationship |
62
|
|
|
|
|
|
|
{ |
63
|
4
|
100
|
|
4
|
|
134
|
$_[1] eq 'extends' or $_[1] eq 'types'; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |