line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
28
|
use v5.14; |
|
2
|
|
|
|
|
7
|
|
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
97
|
|
4
|
2
|
|
|
2
|
|
10
|
no warnings qw(void once uninitialized numeric); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
184
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Moops::Keyword::Library; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
9
|
|
|
|
|
|
|
our $VERSION = '0.037'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
14
|
use Moo; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
12
|
|
|
|
|
|
|
extends 'Moops::Keyword'; |
13
|
2
|
|
|
2
|
|
3037
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
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
|
|
5
|
my $self = shift; |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
7
|
my $use_type_library = "use Type::Library -base"; |
31
|
2
|
50
|
|
|
|
5
|
if (@{ $self->relations->{declares} || [] }) |
|
2
|
50
|
|
|
|
20
|
|
32
|
|
|
|
|
|
|
{ |
33
|
2
|
|
|
|
|
5
|
my @types = @{$self->relations->{declares}}; |
|
2
|
|
|
|
|
10
|
|
34
|
2
|
|
|
|
|
18
|
$use_type_library .= ", -declare => qw(@types)"; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
6
|
my $extends; |
38
|
2
|
50
|
|
|
|
4
|
if (@{ $self->relations->{extends} || [] }) |
|
2
|
50
|
|
|
|
14
|
|
39
|
|
|
|
|
|
|
{ |
40
|
2
|
|
|
|
|
6
|
my @parents = @{$self->relations->{extends}}; |
|
2
|
|
|
|
|
9
|
|
41
|
2
|
|
|
|
|
8
|
$extends = "BEGIN { extends qw(@parents) }"; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
return ( |
45
|
2
|
50
|
|
|
|
27
|
"$use_type_library;", |
46
|
|
|
|
|
|
|
"use Type::Utils -all;", |
47
|
|
|
|
|
|
|
($extends ? "$extends;" : ()), |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub known_relationships |
52
|
|
|
|
|
|
|
{ |
53
|
4
|
|
|
4
|
|
86
|
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
|
|
130
|
$_[1] eq 'extends' or $_[1] eq 'types'; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |