« blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/Plack.pm
↑ Summary
lib/Perl/PrereqScanner/NotQuiteLite/Parser/Moose.pm »
| 1 | package Perl::PrereqScanner::NotQuiteLite::Parser::PackageVariant; | ||||||||||||||||||||||||||||||||||||||||||
| 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 {{ | ||||||||||||||||||||||||||||||||||||||||||
| 8 | 87 | ▶ | use => { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | 'Package::Variant' => 'parse_package_variant_args', | ||||||||||||||||||||||||||||||||||||||||||
| 10 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 11 | }} | ||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | sub parse_package_variant_args { | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 7 | ▶ | my ($class, $c, $used_module, $raw_tokens) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_package_variant_args: called CC=27 SCAR=34.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 7 | my $tokens = convert_string_tokens($raw_tokens); | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 7 | ▶ | while(my $token = shift @$tokens) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 21 | ▶ | if (ref $token and $token->[0] eq 'importing') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
ref $token and $token->[0] eq "importing"
MC/DC100%2/2
ref $token and $token->[0] eq "importing"
ref $token
$token->[0] eq "importing"
Truth table100%3/3
A and B
A= ref $tokenB= $token->[0] eq "importing"
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | ▶ | shift @$tokens if @$tokens && $tokens->[0][1] eq 'COMMA'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@$tokens and $tokens->[0][1] eq "COMMA"
MC/DC0%0/2
@$tokens and $tokens->[0][1] eq "COMMA"
@$tokens
$tokens->[0][1] eq "COMMA"
Truth table33%1/3
A and B
A= @$tokensB= $tokens->[0][1] eq "COMMA"
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | ▶ | my $next_token = shift @$tokens or last; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 5 | ▶ | if (!ref $next_token) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | my $module = $next_token; | |||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | if (is_module_name($module)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | $c->add($module); | |||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | if ($c->has_callback_for(use => $module)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $c->run_callback_for('use', $module, [["use", "KEYWORD"], [$module, "WORD"], [";", ";"]]); | |||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | elsif ($next_token->[1] eq '[]') { | ||||||||||||||||||||||||||||||||||||||||||
| 32 | 3 | my $modules = convert_string_token_list($next_token->[0]); | |||||||||||||||||||||||||||||||||||||||||
| 33 | 3 | ▶ | while(my $module = shift @$modules) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 5 | ▶ | next unless is_module_name($module); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 4 | $c->add($module); | |||||||||||||||||||||||||||||||||||||||||
| 36 | 4 | ▶ | if ($c->has_callback_for(use => $module)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | $c->run_callback_for('use', $module, [["use", "KEYWORD"], [$module, "WORD"], [";", ";"]]); | |||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||
| 40 | } elsif ($next_token->[1] eq '{}') { | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | my $hash_tokens = convert_string_token_list($next_token->[0]); | |||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | ▶ | while(my $module = shift @$hash_tokens) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | my $arg = shift @$hash_tokens; | |||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | ▶ | my @args = $arg->[1] eq '[]' ? @{$arg->[0]} : $arg; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | $c->add($module); | |||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | ▶ | if ($c->has_callback_for(use => $module)) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | $c->run_callback_for('use', $module, [["use", "KEYWORD"], [$module, "WORD"], @args, [";", ";"]]); | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||
| 52 | ▶ | elsif (ref $token && !ref $token->[0] && $token->[1] eq 'WORD') { | |||||||||||||||||||||||||||||||||||||||||
|
Condition100%6/6
ref $token and not ref $token->[0] and $token->[1] eq "WORD"
ref $token and not ref $token->[0]
MC/DC100%3/3
ref $token and not ref $token->[0] and $token->[1] eq "WORD"
ref $token
not ref $token->[0]
$token->[1] eq "WORD"
Truth table100%4/4
A and not(B) and C
A= ref $tokenB= not ref $token->[0]C= $token->[1] eq "WORD"
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | 4 | ▶ | shift @$tokens if @$tokens && $tokens->[0][1] eq 'COMMA'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@$tokens and $tokens->[0][1] eq "COMMA"
MC/DC0%0/2
@$tokens and $tokens->[0][1] eq "COMMA"
@$tokens
$tokens->[0][1] eq "COMMA"
Truth table33%1/3
A and B
A= @$tokensB= $tokens->[0][1] eq "COMMA"
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | 4 | ▶ | shift @$tokens if @$tokens; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | 21 | ▶ | shift @$tokens if @$tokens && ref $tokens->[0] && $tokens->[0][1] eq 'COMMA'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
@$tokens and ref $tokens->[0] and $tokens->[0][1] eq "COMMA"
@$tokens and ref $tokens->[0]
MC/DC66%2/3
@$tokens and ref $tokens->[0] and $tokens->[0][1] eq "COMMA"
@$tokens
ref $tokens->[0]
$tokens->[0][1] eq "COMMA"
Truth table75%3/4
A and B and C
A= @$tokensB= ref $tokens->[0]C= $tokens->[0][1] eq "COMMA"
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 88 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | __END__ | ||||||||||||||||||||||||||||||||||||||||||