line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::APIReference; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
26386
|
use 5.006; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
99
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
83
|
|
5
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
79
|
|
6
|
2
|
|
|
2
|
|
12
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
190
|
|
7
|
2
|
|
|
2
|
|
1489
|
use version; |
|
2
|
|
|
|
|
4939
|
|
|
2
|
|
|
|
|
15
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Class::XSAccessor |
12
|
2
|
|
|
|
|
27
|
getters => { |
13
|
|
|
|
|
|
|
'index' => 'index', |
14
|
|
|
|
|
|
|
'perl_version' => 'perl_version', |
15
|
2
|
|
|
2
|
|
1978
|
}; |
|
2
|
|
|
|
|
7482
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _par_loader_hint { |
18
|
0
|
|
|
0
|
|
0
|
require Perl::APIReference::Generator; |
19
|
0
|
|
|
|
|
0
|
require Perl::APIReference::V5_020_001; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our %Perls = ( |
23
|
|
|
|
|
|
|
5.020002 => 'V5_020_002', |
24
|
|
|
|
|
|
|
5.020001 => 'V5_020_001', |
25
|
|
|
|
|
|
|
5.02 => 'V5_020_000', |
26
|
|
|
|
|
|
|
5.018002 => 'V5_018_002', |
27
|
|
|
|
|
|
|
5.018001 => 'V5_018_001', |
28
|
|
|
|
|
|
|
5.018000 => 'V5_018_000', |
29
|
|
|
|
|
|
|
5.016003 => 'V5_016_003', |
30
|
|
|
|
|
|
|
5.016002 => 'V5_016_002', |
31
|
|
|
|
|
|
|
5.016001 => 'V5_016_001', |
32
|
|
|
|
|
|
|
5.016 => 'V5_016_000', |
33
|
|
|
|
|
|
|
5.014004 => 'V5_014_004', |
34
|
|
|
|
|
|
|
5.014003 => 'V5_014_003', |
35
|
|
|
|
|
|
|
5.014002 => 'V5_014_002', |
36
|
|
|
|
|
|
|
5.014001 => 'V5_014_001', |
37
|
|
|
|
|
|
|
5.014 => 'V5_014_000', |
38
|
|
|
|
|
|
|
5.012005 => 'V5_012_005', |
39
|
|
|
|
|
|
|
5.012004 => 'V5_012_004', |
40
|
|
|
|
|
|
|
5.012003 => 'V5_012_003', |
41
|
|
|
|
|
|
|
5.012002 => 'V5_012_002', |
42
|
|
|
|
|
|
|
5.012001 => 'V5_012_001', |
43
|
|
|
|
|
|
|
5.012 => 'V5_012_000', |
44
|
|
|
|
|
|
|
5.010001 => 'V5_010_001', |
45
|
|
|
|
|
|
|
5.01 => 'V5_010_000', |
46
|
|
|
|
|
|
|
5.008009 => 'V5_008_009', |
47
|
|
|
|
|
|
|
5.008008 => 'V5_008_008', |
48
|
|
|
|
|
|
|
5.008007 => 'V5_008_007', |
49
|
|
|
|
|
|
|
5.008006 => 'V5_008_006', |
50
|
|
|
|
|
|
|
5.008005 => 'V5_008_005', |
51
|
|
|
|
|
|
|
5.008004 => 'V5_008_004', |
52
|
|
|
|
|
|
|
5.008003 => 'V5_008_003', |
53
|
|
|
|
|
|
|
5.008002 => 'V5_008_002', |
54
|
|
|
|
|
|
|
5.008001 => 'V5_008_001', |
55
|
|
|
|
|
|
|
5.008 => 'V5_008_000', |
56
|
|
|
|
|
|
|
5.006002 => 'V5_006_002', |
57
|
|
|
|
|
|
|
5.006001 => 'V5_006_001', |
58
|
|
|
|
|
|
|
5.006 => 'V5_006_000', |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
our $NewestAPI = '5.020002'; |
62
|
|
|
|
|
|
|
our $NewestStableAPI = '5.020002'; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
$Perls{'5.020'} = $Perls{5.02}; |
65
|
|
|
|
|
|
|
$Perls{'5.020000'} = $Perls{5.02}; |
66
|
|
|
|
|
|
|
$Perls{'5.018000'} = $Perls{5.018}; |
67
|
|
|
|
|
|
|
$Perls{'5.016000'} = $Perls{5.016}; |
68
|
|
|
|
|
|
|
$Perls{'5.014000'} = $Perls{5.014}; |
69
|
|
|
|
|
|
|
$Perls{'5.012000'} = $Perls{5.012}; |
70
|
|
|
|
|
|
|
$Perls{'5.010000'} = $Perls{5.01}; |
71
|
|
|
|
|
|
|
$Perls{'5.010'} = $Perls{5.01}; |
72
|
|
|
|
|
|
|
$Perls{'5.008000'} = $Perls{5.008}; |
73
|
|
|
|
|
|
|
$Perls{'5.008000'} = $Perls{5.006}; |
74
|
|
|
|
|
|
|
#$Perls{'5.000'} = $Perls{5}; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub _get_class_name { |
77
|
45
|
|
|
45
|
|
82
|
my $class_or_self = shift; |
78
|
45
|
|
|
|
|
79
|
my $version = shift; |
79
|
45
|
50
|
|
|
|
233
|
return exists $Perls{$version} ? "Perl::APIReference::" . $Perls{$version} : undef; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub new { |
83
|
45
|
|
|
45
|
1
|
30018
|
my $class = shift; |
84
|
45
|
|
|
|
|
167
|
my %args = @_; |
85
|
45
|
|
|
|
|
106
|
my $perl_version = $args{perl_version}; |
86
|
45
|
50
|
|
|
|
183
|
croak("Need perl_version") |
87
|
|
|
|
|
|
|
if not defined $perl_version; |
88
|
45
|
50
|
|
|
|
197
|
$perl_version = $NewestStableAPI if lc($perl_version) eq "newest"; |
89
|
45
|
50
|
|
|
|
154
|
$perl_version = $NewestAPI if lc($perl_version) eq "newest_devel"; |
90
|
|
|
|
|
|
|
|
91
|
45
|
|
|
|
|
931
|
$perl_version = version->new($perl_version)->numify(); |
92
|
45
|
50
|
|
|
|
247
|
croak("Bad perl version '$perl_version'") |
93
|
|
|
|
|
|
|
if not exists $Perls{$perl_version}; |
94
|
|
|
|
|
|
|
|
95
|
45
|
|
|
|
|
156
|
my $classname = __PACKAGE__->_get_class_name($perl_version); |
96
|
45
|
|
|
|
|
7130
|
eval "require $classname;"; |
97
|
45
|
50
|
|
|
|
332
|
croak("Bad perl version ($@)") if $@; |
98
|
|
|
|
|
|
|
|
99
|
45
|
|
|
|
|
399
|
return $classname->new(perl_version => $perl_version); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub as_yaml_calltips { |
103
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
my $index = $self->index(); |
106
|
0
|
|
|
|
|
|
my %toyaml; |
107
|
0
|
|
|
|
|
|
foreach my $entry (keys %$index) { |
108
|
0
|
|
|
|
|
|
my $yentry = { |
109
|
|
|
|
|
|
|
cmd => '', |
110
|
|
|
|
|
|
|
'exp' => $index->{$entry}{text}, |
111
|
|
|
|
|
|
|
}; |
112
|
0
|
|
|
|
|
|
$toyaml{$entry} = $yentry; |
113
|
|
|
|
|
|
|
} |
114
|
0
|
|
|
|
|
|
require YAML::Tiny; |
115
|
0
|
|
|
|
|
|
return YAML::Tiny::Dump(\%toyaml); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# only for ::Generator |
119
|
|
|
|
|
|
|
sub _new_from_parse { |
120
|
0
|
|
|
0
|
|
|
my $class = shift; |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
return bless {@_} => $class; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
# only for ::Generator |
126
|
|
|
|
|
|
|
sub _dump_as_class { |
127
|
0
|
|
|
0
|
|
|
my $self = shift; |
128
|
0
|
|
|
|
|
|
my $version = $self->perl_version; |
129
|
0
|
|
|
|
|
|
my $classname = $self->_get_class_name($version); |
130
|
0
|
0
|
|
|
|
|
if (not defined $classname) { |
131
|
0
|
|
|
|
|
|
die "Can't determine class name for Perl version '$version'." |
132
|
|
|
|
|
|
|
. " Do you need to add it to the list of supported versions first?"; |
133
|
|
|
|
|
|
|
} |
134
|
0
|
|
|
|
|
|
my $file_name = $classname; |
135
|
0
|
|
|
|
|
|
$file_name =~ s/^.*::([^:]+)$/$1.pm/; |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
require Data::Dumper; |
138
|
0
|
|
|
|
|
|
local $Data::Dumper::Indent = 0; |
139
|
0
|
|
|
|
|
|
local $Data::Dumper::Sortkeys = 1; |
140
|
0
|
|
|
|
|
|
my $dumper = Data::Dumper->new([$self->{'index'}]); |
141
|
0
|
|
|
|
|
|
my $dump = $dumper->Dump(); |
142
|
|
|
|
|
|
|
|
143
|
0
|
0
|
|
|
|
|
open my $fh, '>', $file_name or die $!; |
144
|
0
|
|
|
|
|
|
print $fh <
|
145
|
|
|
|
|
|
|
package $classname; |
146
|
|
|
|
|
|
|
use strict; |
147
|
|
|
|
|
|
|
use warnings; |
148
|
|
|
|
|
|
|
use parent 'Perl::APIReference'; |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub new { |
151
|
|
|
|
|
|
|
my \$class = shift; |
152
|
|
|
|
|
|
|
my \$VAR1; |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
do{$dump}; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
my \$self = bless({ |
157
|
|
|
|
|
|
|
'index' => \$VAR1, |
158
|
|
|
|
|
|
|
perl_version => '$version', |
159
|
|
|
|
|
|
|
} => \$class); |
160
|
|
|
|
|
|
|
return \$self; |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
1; |
164
|
|
|
|
|
|
|
HERE |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
1; |
169
|
|
|
|
|
|
|
__END__ |