« blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/POE.pm
↑ Summary
lib/Perl/PrereqScanner/NotQuiteLite/Parser/SyntaxCollector.pm »
| 1 | package Perl::PrereqScanner::NotQuiteLite::Parser::Superclass; | ||||||||||||
| 2 | |||||||||||||
| 3 | 88 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 88 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 88 | ▶ | use Perl::PrereqScanner::NotQuiteLite::Util; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | sub register { return { | ||||||||||||
| 8 | 87 | ▶ | use => { | ||||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 9 | superclass => 'parse_superclass_args', | ||||||||||||
| 10 | }, | ||||||||||||
| 11 | }} | ||||||||||||
| 12 | |||||||||||||
| 13 | sub parse_superclass_args { | ||||||||||||
| 14 | 7 | ▶ | my ($class, $c, $used_module, $raw_tokens) = @_; | ||||||||||
|
Subroutine
parse_superclass_args: called CC=11 SCAR=25.7
Pod
undocumented
| |||||||||||||
| 15 | |||||||||||||
| 16 | 7 | my $tokens = convert_string_tokens($raw_tokens); | |||||||||||
| 17 | 7 | ▶ | if (is_version($tokens->[0])) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 18 | 0 | $c->add($used_module => shift @$tokens); | |||||||||||
| 19 | } | ||||||||||||
| 20 | |||||||||||||
| 21 | 7 | my ($module, $version, $prev); | |||||||||||
| 22 | 7 | for my $token (@$tokens) { | |||||||||||
| 23 | 19 | ▶ | last if $token eq '-norequire'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 24 | 19 | ▶ | if (ref $token) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | 8 | ▶ | last if $token->[0] eq '-norequire'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 8 | $prev = $token->[0]; | |||||||||||
| 27 | 8 | next; | |||||||||||
| 28 | } | ||||||||||||
| 29 | 11 | $prev = $token; | |||||||||||
| 30 | |||||||||||||
| 31 | 11 | ▶ | if (is_module_name($token)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 7 | ▶ | if ($module) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | 0 | ▶ | $c->add($module => $version || 0); | ||||||||||
|
Condition0%0/2
$version || 0
MC/DC0%0/1
$version || 0
$version
Truth table0%0/2
A
A= $version
| |||||||||||||
| 34 | } | ||||||||||||
| 35 | 7 | $module = $token; | |||||||||||
| 36 | 7 | next; | |||||||||||
| 37 | } | ||||||||||||
| 38 | 4 | ▶ | if (is_version($token)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 39 | 4 | $c->add($module => $token); | |||||||||||
| 40 | } | ||||||||||||
| 41 | } | ||||||||||||
| 42 | 7 | ▶ | if ($module) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 43 | 7 | $c->add($module => 0); | |||||||||||
| 44 | } | ||||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | 88 | 1; | |||||||||||
| 48 | |||||||||||||
| 49 | __END__ | ||||||||||||