blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/Inline.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 42 SCAR 37.4
CC
6
Cov
0%
parse_inline_args
42.0
register
2.0
BEGIN
2.0
CRAP 42.0
1 package Perl::PrereqScanner::NotQuiteLite::Parser::Inline;
2  
3 use strict;
4 use warnings;
5 use Perl::PrereqScanner::NotQuiteLite::Util;
6  
7 sub register { return {
8 use => {
9 Inline => 'parse_inline_args',
10 },
11 }}
12  
13 sub parse_inline_args {
14 my ($class, $c, $used_module, $raw_tokens) = @_;
15  
16 my $tokens = convert_string_tokens($raw_tokens);
17  
18 if (is_version($tokens->[0])) {
19 $c->add($used_module => shift @$tokens);
20 }
21 if (ref $tokens->[0] and is_module_name($tokens->[0][0])) {
22 my $module = (shift @$tokens)->[0];
23 if ($module eq 'with') {
24 $module = $tokens->[1];
25 if (is_module_name($module)) {
26 $c->add($module => 0);
27 }
28 } elsif ($module eq 'Config') {
29 # Configuration only
30 } else {
31 $c->add("Inline::".$module => 0);
32 }
33 }
34 }
35  
36 1;
37  
38 __END__