| 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
| |||||||||||
| 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
| |||||||||||
| 20 | die "ERROR: line $lineno: Failed to parse the included file $file\n"; | ||||||||||
| 21 | |||||||||||
| 22 | 4 | return $parse_tree; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 7 | 1; | |||||||||