lib/Perl/PrereqScanner/NotQuiteLite/Parser/Syntax.pm

filter: Statementstmt 85.7% 24 / 28 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 75.5% 34 / 45 SCAR 18.7
CC
6
Cov
76%
parse_syntax_args
7.2
BEGIN
1.0
BEGIN
1.0
CRAP 6.5
« lib/Perl/PrereqScanner/NotQuiteLite/Parser/Only.pm ↑ Summary lib/Perl/PrereqScanner/NotQuiteLite/Parser/KeywordDeclare.pm »
1 package Perl::PrereqScanner::NotQuiteLite::Parser::Syntax;
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 88 my %Unsupported = map {$_ => 1} qw(
8 );
9  
10  
11 sub register { return {
12 87 ▶ use => {
Subroutine register: called CC=1 SCAR=0.0
Pod undocumented
13 syntax => 'parse_syntax_args',
14 },
15 }}
16  
17 sub parse_syntax_args {
18 1 ▶ my ($class, $c, $used_module, $raw_tokens) = @_;
Subroutine parse_syntax_args: called CC=6 SCAR=19.7
Pod undocumented
19  
20 1 my $tokens = convert_string_tokens($raw_tokens);
21  
22 1 ▶ if (is_version($tokens->[0])) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_version($tokens->[0])) 0 1 1
23 0 $c->add($used_module => shift @$tokens);
24 }
25  
26 1 ▶ return if ref $tokens->[0];
Branch: 1 branch
BranchTrueFalseTotal
if ref $tokens->[0] 0 1 1
27  
28 1 my $feature_name = $tokens->[0];
29  
30 1 my $name =
31 join '::',
32 map ucfirst,
33 split m{/},
34 join '',
35 map ucfirst,
36 split qr{_}, $feature_name;
37  
38 1 my $feature_module = "Syntax::Feature::$name";
39 1 ▶ if (is_module_name($feature_module)) {
Branch: 1 branch
BranchTrueFalseTotal
if (is_module_name($feature_module)) 1 0 1
40 1 $c->add($feature_module => 0);
41 }
42  
43 1 ▶ if ($feature_name =~ /^q[sil]$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($feature_name =~ /^q[sil]$/) 1 0 1
44 1 $c->register_quotelike_keywords($feature_name, 'q'.$feature_name);
45 }
46  
47 # Some of the features change syntax too much
48 1 ▶ if ($Unsupported{$feature_name}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Unsupported{$feature_name}) 0 1 1
49 0 $c->{aborted} = "syntax '$feature_name'";
50 0 $c->{ended} = 1;
51 }
52 }
53  
54 88 1;
55  
56 __END__
« lib/Perl/PrereqScanner/NotQuiteLite/Parser/Only.pm ↑ Summary lib/Perl/PrereqScanner/NotQuiteLite/Parser/KeywordDeclare.pm »