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 94     94   1333 use strict;
  94         171  
  94         2932  
4 94     94   384 use warnings;
  94         146  
  94         4186  
5 94     94   441 use Perl::PrereqScanner::NotQuiteLite::Util;
  94         154  
  94         26645  
6              
7             sub register { return {
8 93     93 0 489 use => {
9             Inline => 'parse_inline_args',
10             },
11             }}
12              
13             sub parse_inline_args {
14 7     7 0 11 my ($class, $c, $used_module, $raw_tokens) = @_;
15              
16 7         15 my $tokens = convert_string_tokens($raw_tokens);
17              
18 7 50       16 if (is_version($tokens->[0])) {
19 0         0 $c->add($used_module => shift @$tokens);
20             }
21 7 50 33     20 if (ref $tokens->[0] and is_module_name($tokens->[0][0])) {
22 7         15 my $module = (shift @$tokens)->[0];
23 7 100       19 if ($module eq 'with') {
    100          
24 1         2 $module = $tokens->[1];
25 1 50       2 if (is_module_name($module)) {
26 1         3 $c->add($module => 0);
27             }
28             } elsif ($module eq 'Config') {
29             # Configuration only
30             } else {
31 5         16 $c->add("Inline::".$module => 0);
32             }
33             }
34             }
35              
36             1;
37              
38             __END__