| 1 | # This original Filter::Util::Call-based | ||||||||||||||||||||||||||||
| 2 | # PDL::NiceSlice engine. | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Filter::Util::Call; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | { | ||||||||||||||||||||||||||||
| 9 | 1 | ▶ | no warnings 'redefine'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | sub PDL::NiceSlice::FilterUtilCall::make_filter { | ||||||||||||||||||||||||||
|
Subroutine
make_filter: called CC=1 SCAR=5.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 1 | my ($class,$file,$offset) = @_; | |||||||||||||||||||||||||||
| 12 | 1 | my $terminator = terminator_regexp($class); | |||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||
| 14 | 0 | my ($status, $off, $end); | |||||||||||||||||||||||||||
| 15 | 0 | my $count = 0; | |||||||||||||||||||||||||||
| 16 | 0 | my $data = ""; | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | while ($status = filter_read()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | return $status if $status < 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | if (defined($terminator) && m/$terminator/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $terminator and /$terminator/
MC/DC0%0/2
defined $terminator and /$terminator/
defined $terminator
/$terminator/
Truth table0%0/3
A and B
A= defined $terminatorB= /$terminator/
| |||||||||||||||||||||||||||||
| 20 | 0 | $off=1; | |||||||||||||||||||||||||||
| 21 | 0 | last; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if (m/^\s*(__END__|__DATA__)\s*$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | $end=$1; $off = 1; | |||||||||||||||||||||||||||
| 25 | 0 | last; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 0 | $data .= $_; | |||||||||||||||||||||||||||
| 28 | 0 | $count++; | |||||||||||||||||||||||||||
| 29 | 0 | $_ = ""; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 0 | $_ = $data; | |||||||||||||||||||||||||||
| 32 | 0 | ▶ | $_ = findslice $_ unless $status < 0; # the actual filter | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | $_ .= "no $class;\n" if $off; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 0 | ▶ | $_ .= "$end\n" if $end; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | return $count; | |||||||||||||||||||||||||||
| 36 | 1 | }; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | ▶ | sub import { | ||||||||||||||||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 41 | 1 | my ($class) = @_; | |||||||||||||||||||||||||||
| 42 | 1 | my ($file,$offset) = (caller)[1,2]; # for error reporting | |||||||||||||||||||||||||||
| 43 | ## Parse class name into a regexp suitable for filtration | ||||||||||||||||||||||||||||
| 44 | 1 | filter_add(PDL::NiceSlice::FilterUtilCall::make_filter($class, $file, $offset+1)); | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub unimport { | ||||||||||||||||||||||||||
|
Subroutine
unimport: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 48 | 0 | filter_del(); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 1 | 1; | |||||||||||||||||||||||||||