Cheater/Parser/Util.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 89.6% 26 / 29 CC 3 SCAR 7.0
CC
3
Cov
92%
parse_included_file
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Cheater/AST.pm ↑ Summary Cheater.pm »
1 package Cheater::Parser::Util;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use Exporter qw( import );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 7 our @EXPORT_OK = qw(
8 parse_included_file
9 );
10  
11 4 ▶sub parse_included_file ($$) {
Subroutine parse_included_file: called CC=3 SCAR=11.1
Pod undocumented
12 4 my ($file, $lineno) = @_;
13 4 ▶ open my $in, $file or
Branch: 1 branch
BranchTrueFalseTotal
open my $in, $file or die "Failed to include file ${file}: $!\n" 4 0 4
14 die "Failed to include file $file: $!\n";
15 4 my $src = do { local $/; <$in> };
16 4 close $in;
17  
18 4 my $parser = Cheater::Parser->new;
19 4 ▶ my $parse_tree = $parser->spec($src) or
Branch: 1 branch
BranchTrueFalseTotal
my $parse_tree = $parser->spec($src) or die "ERROR: line ${lineno}: Failed to parse the included file $file\n" 4 0 4
20 die "ERROR: line $lineno: Failed to parse the included file $file\n";
21  
22 4 return $parse_tree;
23 }
24  
25 7 1;
« Cheater/AST.pm ↑ Summary Cheater.pm »