File Coverage

lib/Perl/PrereqScanner/NotQuiteLite/Parser/Inline.pm
Criterion Covered Total %
statement 20 21 95.2
branch 7 10 70.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 0 2 0.0
total 33 41 80.4


line stmt bran cond sub pod time code
1             package Perl::PrereqScanner::NotQuiteLite::Parser::Inline;
2              
3 82     82   1247 use strict;
  82         160  
  82         2118  
4 82     82   435 use warnings;
  82         165  
  82         1774  
5 82     82   384 use Perl::PrereqScanner::NotQuiteLite::Util;
  82         152  
  82         21490  
6              
7             sub register { return {
8 81     81 0 413 use => {
9             Inline => 'parse_inline_args',
10             },
11             }}
12              
13             sub parse_inline_args {
14 7     7 0 13 my ($class, $c, $used_module, $raw_tokens) = @_;
15              
16 7         14 my $tokens = convert_string_tokens($raw_tokens);
17              
18 7 50       17 if (is_version($tokens->[0])) {
19 0         0 $c->add($used_module => shift @$tokens);
20             }
21 7 50 33     21 if (ref $tokens->[0] and is_module_name($tokens->[0][0])) {
22 7         15 my $module = (shift @$tokens)->[0];
23 7 100       18 if ($module eq 'with') {
    100          
24 1         3 $module = $tokens->[1];
25 1 50       2 if (is_module_name($module)) {
26 1         4 $c->add($module => 0);
27             }
28             } elsif ($module eq 'Config') {
29             # Configuration only
30             } else {
31 5         18 $c->add("Inline::".$module => 0);
32             }
33             }
34             }
35              
36             1;
37              
38             __END__