line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::PrereqScanner::Lite::Scanner::Version; |
2
|
1
|
|
|
1
|
|
677
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
4
|
1
|
|
|
1
|
|
4
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
5
|
1
|
|
|
1
|
|
17
|
use Perl::PrereqScanner::Lite::Constants; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
229
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub scan { |
8
|
0
|
|
|
0
|
0
|
|
my ($class, $c, $token, $token_type) = @_; |
9
|
|
|
|
|
|
|
|
10
|
0
|
0
|
0
|
|
|
|
if ($token_type == KEY || $token_type == NAMESPACE || $token_type == NAMESPACE_RESOLVER) { |
|
|
|
0
|
|
|
|
|
11
|
0
|
|
|
|
|
|
$c->{not_decl_module_name} .= $token->{data}; |
12
|
0
|
|
|
|
|
|
return 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
0
|
0
|
0
|
|
|
|
if ($token_type == METHOD && $token->{data} eq 'VERSION') { |
16
|
0
|
|
|
|
|
|
$c->{is_version_decl} = 1; |
17
|
0
|
|
|
|
|
|
return 1; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
0
|
|
|
|
if ($c->{is_version_decl} && $token_type == INT || $token_type == DOUBLE || $token_type == VERSION_STRING) { |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
if ($c->{module_reqs}->{requirements}->{$c->{not_decl_module_name}}) { |
22
|
0
|
|
|
|
|
|
$c->add_minimum($c->{not_decl_module_name} => $token->{data}); |
23
|
|
|
|
|
|
|
} |
24
|
0
|
|
|
|
|
|
$c->{is_version_decl} = 0; |
25
|
0
|
|
|
|
|
|
$c->{not_decl_module_name} = ''; |
26
|
0
|
|
|
|
|
|
return 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
if ($token_type == SEMI_COLON) { |
30
|
0
|
|
|
|
|
|
$c->{is_version_decl} = 0; |
31
|
0
|
|
|
|
|
|
$c->{not_decl_module_name} = ''; |
32
|
0
|
|
|
|
|
|
return 1; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding utf-8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Perl::PrereqScanner::Lite::Scanner::Version - Extra Perl::PrereqScanner::Lite Scanner for VERSION method |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
use Perl::PrereqScanner::Lite; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $scanner = Perl::PrereqScanner::Lite->new; |
49
|
|
|
|
|
|
|
$scanner->add_extra_scanner('Version'); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 DESCRIPTION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Perl::PrereqScanner::Lite::Scanner::Version is the extra scanner for Perl::PrereqScanner::Lite. |
54
|
|
|
|
|
|
|
This scanner supports C method. It retrieves version from the argument of C. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
For example, |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
require Foo::Bar; |
59
|
|
|
|
|
|
|
Foo::Bar->VERSION(1.00); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 LICENSE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Copyright (C) moznion. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
66
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 AUTHOR |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
moznion Emoznion@gmail.comE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|