/usr/local/lib/perl5/site_perl/5.44.0/Sub/Quote.pm

filter: Statementstmt 71.1% 321 / 451 Branchbran 40.1% 162 / 404 Conditioncond 13.9% 11 / 79 MC/DCmcdc 4.2% 2 / 47 Subroutinesub 85.3% 76 / 89 Podpod 100% 8 / 8 totaltotal 53.8% 580 / 1078 CC 219 SCAR 38.5
CC
219
Cov
53%
quotify
176.8
BEGIN
138.5
inlinify
90.0
CRAP 47.0
« /usr/local/lib/perl5/site_perl/5.44.0/Pod/Coverage.pm ↑ Summary lib/Skilletor/Resolver.pm »
1 package Sub::Quote;
2  
3 0 ▶sub _clean_eval { eval $_[0] }
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine BEGIN: called CC=1 SCAR=0.5
Subroutine _clean_eval: called CC=1 SCAR=0.5
Subroutine _loaded: called CC=3 SCAR=12.5
Subroutine cache_root: called CC=3 SCAR=12.5
Subroutine claude_config_dir: called CC=3 SCAR=12.5
Subroutine codex_home: called CC=3 SCAR=12.5
Subroutine dir: called CC=3 SCAR=12.5
Subroutine hermes_home: called CC=3 SCAR=12.5
Subroutine host: not called CC=3 SCAR=12.5
Subroutine http: not called CC=3 SCAR=12.5
Subroutine local_path: called CC=3 SCAR=12.5
Subroutine markers: called CC=3 SCAR=12.5
Subroutine new: called CC=17 SCAR=34.8
Subroutine new: called CC=15 SCAR=33.0
Subroutine new: called CC=17 SCAR=34.8
Subroutine new: called CC=17 SCAR=34.8
Subroutine new: called CC=14 SCAR=32.0
Subroutine plugin_root: not called CC=3 SCAR=12.5
Subroutine project_path: called CC=3 SCAR=12.5
Subroutine state_root: called CC=3 SCAR=12.5
Subroutine user: not called CC=3 SCAR=12.5
Subroutine user_path: called CC=3 SCAR=12.5
Branch: 116 branches
BranchTrueFalseTotal
if @_ > 1 0 65 65
exists $_[0]{'_loaded'} ? : 59 6 65
if @_ > 1 0 11 11
exists $_[0]{'cache_root'} ? : 8 3 11
if @_ > 1 0 40 40
exists $_[0]{'claude_config_dir'} ? : 39 1 40
if @_ > 1 0 26 26
exists $_[0]{'codex_home'} ? : 23 3 26
if @_ > 1 0 6 6
exists $_[0]{'dir'} ? : 3 3 6
if @_ > 1 0 18 18
exists $_[0]{'hermes_home'} ? : 15 3 18
if @_ > 1 0 0 0
exists $_[0]{'host'} ? : 0 0 0
if @_ > 1 0 0 0
exists $_[0]{'http'} ? : 0 0 0
if @_ > 1 0 6 6
exists $_[0]{'local_path'} ? : 0 6 6
if @_ > 1 0 5 5
exists $_[0]{'markers'} ? : 2 3 5
ref $invoker ? : 0 44 44
if ($class ne "Method::Generate::Constructor") 0 44 44
if ($Moo::MAKERS{$class}) { } 0 0 0
elsif ($INC{'Moose.pm'} and my $meta = Class::MOP::get_metaclass_by_name($class)) { } 0 0 0
if ($Moo::MAKERS{$class}{"constructor"}) 0 0 0
$class->can('BUILDARGS') ? : 0 0 0
scalar @_ == 1 ? : 0 44 44
ref $_[0] eq 'HASH' ? : 0 0 0
@_ % 2 ? : 0 44 44
exists $args->{"accessor_generator"} and $new->{"accessor_generator"} = $args->{"accessor_generator"} 44 0 44
exists $args->{"attribute_specs"} and $new->{"attribute_specs"} = $args->{"attribute_specs"} 0 44 44
exists $args->{"construction_builder"} and $new->{"construction_builder"} = $args->{"construction_builder"} 0 44 44
exists $args->{"construction_string"} and $new->{"construction_string"} = $args->{"construction_string"} 5 39 44
exists $args->{"package"} and $new->{"package"} = $args->{"package"} 44 0 44
exists $args->{"subconstructor_handler"} and $new->{"subconstructor_handler"} = $args->{"subconstructor_handler"} 44 0 44
ref $invoker ? : 0 28 28
if ($class ne "Skilletor::Engine") 0 28 28
if ($Moo::MAKERS{$class}) { } 0 0 0
elsif ($INC{'Moose.pm'} and my $meta = Class::MOP::get_metaclass_by_name($class)) { } 0 0 0
if ($Moo::MAKERS{$class}{"constructor"}) 0 0 0
$class->can('BUILDARGS') ? : 0 0 0
scalar @_ == 1 ? : 0 28 28
ref $_[0] eq 'HASH' ? : 0 0 0
@_ % 2 ? : 0 28 28
if (my(@missing) = grep((!exists $args->{$_}), "home")) 0 28 28
exists $args->{"cache_root"} and $new->{"cache_root"} = $args->{"cache_root"} 4 24 28
exists $args->{"claude_config_dir"} and $new->{"claude_config_dir"} = $args->{"claude_config_dir"} 27 1 28
exists $args->{"codex_home"} and $new->{"codex_home"} = $args->{"codex_home"} 0 28 28
exists $args->{'fetch'} ? : 0 1 1
eval { do { $@ = $_old_error, &$isa_check_for_fetch($value), 1 } } or $_error = ref $@ ? $@ : 'isa check for "fetch" failed: ' . $@ 1 0 1
ref $@ ? : 0 0 0
defined $_error and die $_error 0 1 1
exists $args->{'git_remote'} ? : 0 1 1
exists $args->{'git_tracked'} ? : 0 1 1
exists $args->{"hermes_home"} and $new->{"hermes_home"} = $args->{"hermes_home"} 0 1 1
exists $args->{"home"} and $new->{"home"} = $args->{"home"} 1 0 1
exists $args->{"host"} and $new->{"host"} = $args->{"host"} 0 1 1
exists $args->{'is_git_work_tree'} ? : 0 1 1
exists $args->{'lock_timeout_ms'} ? : 0 1 1
exists $args->{"markers"} and $new->{"markers"} = $args->{"markers"} 0 1 1
exists $args->{"plugin_root"} and $new->{"plugin_root"} = $args->{"plugin_root"} 0 1 1
exists $args->{"project_dir"} and $new->{"project_dir"} = $args->{"project_dir"} 1 0 1
exists $args->{'require_harness'} ? : 0 1 1
exists $args->{"state_root"} and $new->{"state_root"} = $args->{"state_root"} 0 1 1
exists $args->{"timeout_ms"} and $new->{"timeout_ms"} = $args->{"timeout_ms"} 0 1 1
exists $args->{"user"} and $new->{"user"} = $args->{"user"} 0 1 1
ref $invoker ? : 0 7 7
if ($class ne "Skilletor::State") 0 7 7
if ($Moo::MAKERS{$class}) { } 0 0 0
elsif ($INC{'Moose.pm'} and my $meta = Class::MOP::get_metaclass_by_name($class)) { } 0 0 0
if ($Moo::MAKERS{$class}{"constructor"}) 0 0 0
$class->can('BUILDARGS') ? : 0 0 0
scalar @_ == 1 ? : 0 7 7
ref $_[0] eq 'HASH' ? : 0 0 0
@_ % 2 ? : 0 7 7
if (my(@missing) = grep((!exists $args->{$_}), "root")) 0 7 7
exists $args->{"read_once"} and $new->{"read_once"} = $args->{"read_once"} 2 5 7
exists $args->{"root"} and $new->{"root"} = $args->{"root"} 7 0 7
+($args)[0]->{"__no_BUILD__"} or $new->Skilletor::State::BUILD($args) 1 6 7
ref $invoker ? : 0 8 8
if ($class ne "Skilletor::Config") 2 6 8
if ($Moo::MAKERS{$class}) { } 0 0 0
elsif ($INC{'Moose.pm'} and my $meta = Class::MOP::get_metaclass_by_name($class)) { } 0 2 2
if ($Moo::MAKERS{$class}{"constructor"}) 0 2 2
$class->can('BUILDARGS') ? : 0 2 2
scalar @_ == 1 ? : 0 7 7
ref $_[0] eq 'HASH' ? : 2 0 2
@_ % 2 ? : 0 7 7
if (my(@missing) = grep((!exists $args->{$_}), "home")) 0 7 7
exists $args->{"claude_config_dir"} and $new->{"claude_config_dir"} = $args->{"claude_config_dir"} 5 2 7
exists $args->{"home"} and $new->{"home"} = $args->{"home"} 5 2 7
exists $args->{"project_dir"} and $new->{"project_dir"} = $args->{"project_dir"} 5 2 7
exists $args->{"unchecked"} and $new->{"unchecked"} = $args->{"unchecked"} 2 5 7
+($args)[0]->{"__no_BUILD__"} or $new->Skilletor::Config::BUILD($args) 0 7 7
ref $invoker ? : 2 5 7
if ($class ne "Skilletor::Source::Local") 2 5 7
if ($Moo::MAKERS{$class}) { } 0 2 2
elsif ($INC{'Moose.pm'} and my $meta = Class::MOP::get_metaclass_by_name($class)) { } 0 0 0
if ($Moo::MAKERS{$class}{"constructor"}) 0 0 0
$class->can('BUILDARGS') ? : 0 0 0
scalar @_ == 1 ? : 0 5 5
ref $_[0] eq 'HASH' ? : 0 0 0
@_ % 2 ? : 0 5 5
if (my(@missing) = grep((!exists $args->{$_}), "local_path")) 0 5 5
exists $args->{"home"} and $new->{"home"} = $args->{"home"} 0 5 5
exists $args->{"local_path"} and $new->{"local_path"} = $args->{"local_path"} 5 0 5
if @_ > 1 0 0 0
exists $_[0]{'plugin_root'} ? : 0 0 0
if @_ > 1 0 6 6
exists $_[0]{'project_path'} ? : 0 6 6
if @_ > 1 0 32 32
exists $_[0]{'state_root'} ? : 31 1 32
if @_ > 1 0 0 0
exists $_[0]{'user'} ? : 0 0 0
if @_ > 1 0 6 6
exists $_[0]{'user_path'} ? : 0 6 6
Condition0%0/15
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
!ll&&!rl&&r
000
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
!ll&&!rl&&r
000
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
!ll&&!rl&&r
000
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
!ll&&!rl&&r
000
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
$INC{"Moose.pm"} my $meta = Class::MOP::get_metaclass_by_name($class)
MC/DC0%0/2
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
$INC{"Moose.pm"} my $meta = Class::MOP::get_metaclass_by_name($class)
MC/DC0%0/2
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
$INC{"Moose.pm"} my $meta = Class::MOP::get_metaclass_by_name($class)
MC/DC0%0/2
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
$INC{"Moose.pm"} my $meta = Class::MOP::get_metaclass_by_name($class)
MC/DC0%0/2
$INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)
$INC{"Moose.pm"} my $meta = Class::MOP::get_metaclass_by_name($class)
Truth table0%0/3
A and B
A= $INC{"Moose.pm"}B= my $meta = Class::MOP::get_metaclass_by_name($class)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $INC{"Moose.pm"}B= my $meta = Class::MOP::get_metaclass_by_name($class)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $INC{"Moose.pm"}B= my $meta = Class::MOP::get_metaclass_by_name($class)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $INC{"Moose.pm"}B= my $meta = Class::MOP::get_metaclass_by_name($class)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $INC{"Moose.pm"}B= my $meta = Class::MOP::get_metaclass_by_name($class)
ABresult
0X0
100
111
4  
5 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 our $VERSION = '2.006009';
9 7 $VERSION =~ tr/_//d;
10  
11 7 ▶use Sub::Defer qw(defer_sub);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 7 ▶use Exporter ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14 7 ▶BEGIN { *import = \&Exporter::import }
Subroutine BEGIN: called CC=1 SCAR=0.0
15 7 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
16 7 ▶BEGIN { our @CARP_NOT = qw(Sub::Defer) }
Subroutine BEGIN: called CC=1 SCAR=0.0
17 7 ▶BEGIN {
Subroutine BEGIN: called CC=20 SCAR=49.3
18 7 my $TRUE = sub(){!!1};
19 7 my $FALSE = sub(){!!0};
20 7 ▶ *_HAVE_IS_UTF8 = defined &utf8::is_utf8 ? $TRUE : $FALSE;
Branch: 1 branch
BranchTrueFalseTotal
defined &utf8::is_utf8 ? : 7 0 7
21 7 ▶ *_CAN_TRACK_BOOLEANS = defined &builtin::is_bool ? $TRUE : $FALSE;
Branch: 1 branch
BranchTrueFalseTotal
defined &builtin::is_bool ? : 7 0 7
22 7 ▶ *_CAN_TRACK_NUMBERS = defined &builtin::created_as_number ? $TRUE : $FALSE;
Branch: 1 branch
BranchTrueFalseTotal
defined &builtin::created_as_number ? : 7 0 7
23 7 ▶ *_HAVE_HEX_FLOAT = !$ENV{SUB_QUOTE_NO_HEX_FLOAT} && "$]" >= 5.022 ? $TRUE : $FALSE;
Branch: 1 branch
BranchTrueFalseTotal
!$ENV{'SUB_QUOTE_NO_HEX_FLOAT'} && "$]" >= 5.022 ? : 7 0 7
Condition33%1/3
not $ENV{"SUB_QUOTE_NO_HEX_FLOAT"} and "$]" >= "5.022"
!ll&&!rl&&r
007
MC/DC0%0/2
not $ENV{"SUB_QUOTE_NO_HEX_FLOAT"} and "$]" >= "5.022"
not $ENV{"SUB_QUOTE_NO_HEX_FLOAT"} "$]" >= "5.022"
Truth table33%1/3
not(A) and B
A= not $ENV{"SUB_QUOTE_NO_HEX_FLOAT"}B= "$]" >= "5.022"
ABresult
0X0
100
111
24  
25 # This may not be perfect, as we can't tell the format purely from the size
26 # but it should cover the common cases, and other formats are more likely to
27 # be less precise.
28 7 my $nvsize = 8 * length pack 'F', 0;
29 7 ▶ my $nvmantbits
Branch: 6 branches
BranchTrueFalseTotal
$nvsize == 16 ? : 0 7 7
$nvsize == 32 ? : 0 7 7
$nvsize == 64 ? : 7 0 7
$nvsize == 80 ? : 0 0 0
$nvsize == 128 ? : 0 0 0
$nvsize == 256 ? : 0 0 0
30 = $nvsize == 16 ? 11
31 : $nvsize == 32 ? 24
32 : $nvsize == 64 ? 53
33 : $nvsize == 80 ? 64
34 : $nvsize == 128 ? 113
35 : $nvsize == 256 ? 237
36 : 237 # unknown float format
37 ;
38 7 my $precision = int( log(2)/log(10)*$nvmantbits );
39  
40 0 ▶ *_NVSIZE = sub(){ $nvsize };
Subroutine __ANON__: not called CC=1 SCAR=1.2
41 0 ▶ *_NVMANTBITS = sub(){ $nvmantbits };
Subroutine __ANON__: not called CC=1 SCAR=1.2
42 0 ▶ *_FLOAT_PRECISION = sub(){ $precision };
Subroutine __ANON__: not called CC=1 SCAR=1.2
43  
44 7 local $@;
45 # if B is already loaded, just use its perlstring
46 7 ▶ if ("$]" >= 5.008_000 && "$]" != 5.010_000 && defined &B::perlstring) {
Branch: 4 branches
BranchTrueFalseTotal
if ("$]" >= 5.008 and "$]" != 5.01 and defined &B::perlstring) { } 7 0 7
elsif (eval { do { require XString; 'XString'->VERSION(0.003) } }) { } 0 0 0
elsif ("$]" == 5.01) { } 0 0 0
elsif ("$]" >= 5.008 and eval { do { require B; 1 } } and defined &B::perlstring) { } 0 0 0
Condition33%2/6
"$]" >= "5.008" and "$]" != "5.01" and defined &B::perlstring
!ll&&!rl&&r
007
"$]" >= "5.008" and "$]" != "5.01"
!ll&&!rl&&r
007
MC/DC0%0/3
"$]" >= "5.008" and "$]" != "5.01" and defined &B::perlstring
"$]" >= "5.008" "$]" != "5.01" defined &B::perlstring
Truth table25%1/4
A and B and C
A= "$]" >= "5.008"B= "$]" != "5.01"C= defined &B::perlstring
ABCresult
0XX0
10X0
1100
1111
47 7 *_perlstring = \&B::perlstring;
48 }
49 # XString is smaller than B, so prefer to use it. Buggy until 0.003.
50 0 elsif (eval { require XString; XString->VERSION(0.003) }) {
51 0 *_perlstring = \&XString::perlstring;
52 }
53 # B::perlstring in perl 5.10 handles escaping incorrectly on utf8 strings
54 elsif ("$]" == 5.010_000) {
55 0 my %escape = (
56 (map +(chr($_) => sprintf '\x%02x', $_), 0 .. 0x31, 0x7f),
57 "\t" => "\\t",
58 "\n" => "\\n",
59 "\r" => "\\r",
60 "\f" => "\\f",
61 "\b" => "\\b",
62 "\a" => "\\a",
63 "\e" => "\\e",
64 (map +($_ => "\\$_"), qw(" \\ $ @)),
65 );
66 0 ▶ *_perlstring = sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
67 0 my $value = shift;
68 0 $value =~ s{(["\$\@\\[:cntrl:]]|[^\x00-\x7f])}{
69 0 ▶ $escape{$1} || sprintf('\x{%x}', ord($1))
Condition0%0/3
$escape{$1} || sprintf('\\x{%x}', ord $1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$escape{$1} || sprintf('\\x{%x}', ord $1)
$escape{$1} sprintf('\\x{%x}', ord $1)
Truth table0%0/3
A || B
A= $escape{$1}B= sprintf('\\x{%x}', ord $1)
ABresult
1X1
011
000
70 }ge;
71 0 qq["$value"];
72 0 };
73 }
74 0 ▶ elsif ("$]" >= 5.008_000 && eval { require B; 1 } && defined &B::perlstring ) {
Condition0%0/6
"$]" >= "5.008" and eval { do { require B; 1 } } and defined &B::perlstring
!ll&&!rl&&r
000
"$]" >= "5.008" and eval { do { require B; 1 } }
!ll&&!rl&&r
000
MC/DC0%0/3
"$]" >= "5.008" and eval { do { require B; 1 } } and defined &B::perlstring
"$]" >= "5.008" eval { do { require B; 1 } } defined &B::perlstring
Truth table0%0/4
A and B and C
A= "$]" >= "5.008"B= eval { do { require B; 1 } }C= defined &B::perlstring
ABCresult
0XX0
10X0
1100
1111
75 0 *_perlstring = \&B::perlstring;
76 }
77 # on perl 5.6, perlstring is not available. quotemeta will mostly serve as a
78 # replacement. it quotes just by adding lots of backslashes though. if a
79 # utf8 string was written out directly as bytes, it wouldn't get interpreted
80 # correctly if not under 'use utf8'. this is mostly a theoretical concern,
81 # but enough to stick with perlstring when possible.
82 else {
83 0 ▶ *_perlstring = sub { qq["\Q$_[0]\E"] };
Subroutine __ANON__: not called CC=1 SCAR=6.9
84 }
85 }
86  
87 7 our @EXPORT = qw(quote_sub unquote_sub quoted_from_sub qsub);
88 7 our @EXPORT_OK = qw(quotify capture_unroll inlinify sanitize_identifier);
89  
90 7 our %QUOTED;
91  
92 1260 ▶sub quotify {
Subroutine quotify: called CC=21 SCAR=51.7
Pod documented
93 1260 my $value = $_[0];
94 7 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
95 7 ▶ BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
96 7 warnings->unimport(qw(experimental::builtin))
97 if _CAN_TRACK_BOOLEANS || _CAN_TRACK_NUMBERS;
98 }
99 ! defined $value ? 'undef()'
100 : _CAN_TRACK_BOOLEANS && builtin::is_bool($value) ? (
101 $value ? '(!!1)' : '(!!0)'
102 )
103 # numeric detection
104 : (
105 _CAN_TRACK_NUMBERS
106 ? builtin::created_as_number($value)
107 : (
108 !(_HAVE_IS_UTF8 && utf8::is_utf8($value))
109 && length( (my $dummy = '') & $value )
110 && 0 + $value eq $value
111 )
112 ) ? (
113 $value != $value ? (
114 $value eq (9**9**9*0)
115 ? '(9**9**9*0)' # nan
116 : '(-(9**9**9*0))' # -nan
117 )
118 : $value == 9**9**9 ? '(9**9**9)' # inf
119 : $value == -9**9**9 ? '(-9**9**9)' # -inf
120 : $value == 0 ? (
121 sprintf('%g', $value) eq '-0' ? '-0.0' : '0',
122 )
123 : $value !~ /[e.]/i ? (
124 $value > 0 ? (sprintf '%u', $value)
125 : (sprintf '%d', $value)
126 )
127 1260 ▶ : do {
Branch: 12 branches
BranchTrueFalseTotal
!defined($value) ? : 4 1256 1260
builtin::is_bool($value) ? : 0 1256 1256
$value ? : 0 0 0
&builtin::created_as_number($value) ? : 100 1156 1256
$value != $value ? : 0 100 100
$value eq sin(9**9**9) ? : 0 0 0
$value == 9**9**9 ? : 0 100 100
$value == -9**9**9 ? : 0 100 100
$value == 0 ? : 0 100 100
sprintf('%g', $value) eq '-0' ? : 0 0 0
!($value =~ /[e.]/i) ? : 100 0 100
$value > 0 ? : 100 0 100
128 0 my $float = $value;
129 0 my $max_factor = int( log( abs($value) ) / log(2) ) - _NVMANTBITS;
130 0 ▶ my $ex_sign = $max_factor > 0 ? 1 : -1;
Branch: 1 branch
BranchTrueFalseTotal
$max_factor > 0 ? : 0 0 0
131 0 FACTOR: for my $ex (0 .. abs($max_factor)) {
132 0 my $num = $value / 2**($ex_sign * $ex);
133 0 for my $precision (_FLOAT_PRECISION .. _FLOAT_PRECISION+2) {
134 0 my $formatted = sprintf '%0.'.$precision.'g', $num;
135 0 ▶ $float = $formatted
Branch: 1 branch
BranchTrueFalseTotal
if $ex == 0 0 0 0
136 if $ex == 0;
137 0 ▶ if ($formatted == $num) {
Branch: 1 branch
BranchTrueFalseTotal
if ($formatted == $num) 0 0 0
138 0 ▶ if ($ex) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ex) 0 0 0
139 0 ▶ $float
Branch: 2 branches
BranchTrueFalseTotal
$ex_sign == 1 ? : 0 0 0
$ex > 53 ? : 0 0 0
140 = $formatted
141 . ($ex_sign == 1 ? '*' : '/')
142 . (
143 $ex > _NVMANTBITS
144 ? "2**$ex"
145 : sprintf('%u', 2**$ex)
146 );
147 }
148 0 last FACTOR;
149 }
150 }
151 0 if (_HAVE_HEX_FLOAT) {
152 0 $float = sprintf '%a', $value;
153 0 last FACTOR;
154 }
155 }
156 0 "$float";
157 }
158 )
159 : !_CAN_TRACK_BOOLEANS && !length($value) && length( (my $dummy2 = '') & $value ) ? '(!!0)' # false
160 : _perlstring($value);
161 }
162  
163 25 ▶sub sanitize_identifier {
Subroutine sanitize_identifier: called CC=1 SCAR=0.0
Pod documented
164 25 my $name = shift;
165 25 $name =~ s/([_\W])/sprintf('_%x', ord($1))/ge;
166 25 $name;
167 }
168  
169 100 ▶sub capture_unroll {
Subroutine capture_unroll: called CC=2 SCAR=7.0
Pod documented
170 100 my ($from, $captures, $indent) = @_;
171 join(
172 '',
173 map {
174 100 ▶ /^([\@\%\$])/
Branch: 1 branch
BranchTrueFalseTotal
/^([\@\%\$])/ or croak("capture key should start with \@, % or \$: $_") 225 0 225
175 or croak "capture key should start with \@, \% or \$: $_";
176 225 (' ' x $indent).qq{my ${_} = ${1}{${from}->{${\quotify $_}}};\n};
177 } keys %$captures
178 );
179 }
180  
181 0 ▶sub inlinify {
Subroutine inlinify: not called CC=9 SCAR=45.0
Pod documented
182 0 my ($code, $args, $extra, $local) = @_;
183 0 ▶ $args = '()'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args 0 0 0
184 if !defined $args;
185 0 ▶ my $do = 'do { '.($extra||'');
Condition0%0/2
$extra || ''
l!l
00
MC/DC0%0/1
$extra || ''
$extra
Truth table0%0/2
A
A= $extra
Aresult
11
00
186 0 ▶ if ($code =~ s/^(\s*package\s+([a-zA-Z0-9:]+);)//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($code =~ s/^(\s*package\s+([a-zA-Z0-9:]+);)//) 0 0 0
187 0 $do .= $1;
188 }
189 0 ▶ if ($code =~ s{
Branch: 2 branches
BranchTrueFalseTotal
if ($code =~ s/ \A((?:\#\ BEGIN\ quote_sub\ PRELUDE\n.*?\#\ END\ quote_sub\ PRELUDE\n)?\s*) (^\s*) my \s* \(([^)]+)\) \s* = \s* \@_; //msx) { } 0 0 0
elsif ($local or $args ne '@_') { } 0 0 0
190 \A((?:\#\ BEGIN\ quote_sub\ PRELUDE\n.*?\#\ END\ quote_sub\ PRELUDE\n)?\s*)
191 (^\s*) my \s* \(([^)]+)\) \s* = \s* \@_;
192 }{}xms) {
193 0 my ($pre, $indent, $code_args) = ($1, $2, $3);
194 0 $do .= $pre;
195 0 ▶ if ($code_args ne $args) {
Branch: 1 branch
BranchTrueFalseTotal
if ($code_args ne $args) 0 0 0
196 0 $do .= $indent . 'my ('.$code_args.') = ('.$args.'); ';
197 }
198 }
199 ▶ elsif ($local || $args ne '@_') {
Condition0%0/3
$local or $args ne "\@_"
l!l&&r!l&&!r
000
MC/DC0%0/2
$local or $args ne "\@_"
$local $args ne "\@_"
Truth table0%0/3
A or B
A= $localB= $args ne "\@_"
ABresult
1X1
011
000
200 0 ▶ $do .= ($local ? 'local ' : '').'@_ = ('.$args.'); ';
Branch: 1 branch
BranchTrueFalseTotal
$local ? : 0 0 0
201 }
202 0 $do.$code.' }';
203 }
204  
205 100 ▶sub quote_sub {
Subroutine quote_sub: called CC=28 SCAR=44.0
Pod documented
206 # HOLY DWIMMERY, BATMAN!
207 # $name => $code => \%captures => \%options
208 # $name => $code => \%captures
209 # $name => $code
210 # $code => \%captures => \%options
211 # $code
212 100 ▶ my $options =
Branch: 1 branch
BranchTrueFalseTotal
ref $_[-1] eq 'HASH' && ref $_[-2] eq 'HASH' ? : 100 0 100
Condition33%1/3
ref $_[-1] eq "HASH" and ref $_[-2] eq "HASH"
!ll&&!rl&&r
00100
MC/DC0%0/2
ref $_[-1] eq "HASH" and ref $_[-2] eq "HASH"
ref $_[-1] eq "HASH" ref $_[-2] eq "HASH"
Truth table33%1/3
A and B
A= ref $_[-1] eq "HASH"B= ref $_[-2] eq "HASH"
ABresult
0X0
100
111
213 (ref($_[-1]) eq 'HASH' and ref($_[-2]) eq 'HASH')
214 ? pop
215 : {};
216 100 ▶ my $captures = ref($_[-1]) eq 'HASH' ? pop : undef;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[-1] eq 'HASH' ? : 100 0 100
217 100 ▶ undef($captures) if $captures && !keys %$captures;
Branch: 1 branch
BranchTrueFalseTotal
if $captures and not keys %$captures 93 7 100
Condition66%2/3
$captures and not keys %$captures
!ll&&!rl&&r
0793
MC/DC50%1/2
$captures and not keys %$captures
$captures not keys %$captures
Truth table66%2/3
A and not(B)
A= $capturesB= not keys %$captures
ABresult
0X0
100
111
218 100 my $code = pop;
219 100 my $name = $_[0];
220 100 ▶ if ($name) {
Branch: 1 branch
BranchTrueFalseTotal
if ($name) 100 0 100
221 100 my $subname = $name;
222 100 ▶ my $package = $subname =~ s/(.*)::// ? $1 : caller;
Branch: 1 branch
BranchTrueFalseTotal
$subname =~ s/(.*)::// ? : 100 0 100
223 100 $name = join '::', $package, $subname;
224 100 ▶ croak qq{package name "$package" too long!}
Branch: 1 branch
BranchTrueFalseTotal
if length $package > 252 0 100 100
225 if length $package > 252;
226 100 ▶ croak qq{package name "$package" is not valid!}
Branch: 1 branch
BranchTrueFalseTotal
unless $package =~ /^[^\d\W]\w*(?:::\w+)*$/ 0 100 100
227 unless $package =~ /^[^\d\W]\w*(?:::\w+)*$/;
228 100 ▶ croak qq{sub name "$subname" too long!}
Branch: 1 branch
BranchTrueFalseTotal
if length $subname > 252 0 100 100
229 if length $subname > 252;
230 100 ▶ croak qq{sub name "$subname" is not valid!}
Branch: 1 branch
BranchTrueFalseTotal
unless $subname =~ /^[^\d\W]\w*$/ 0 100 100
231 unless $subname =~ /^[^\d\W]\w*$/;
232 }
233 100 my @caller = caller(0);
234 100 my ($attributes, $file, $line) = @{$options}{qw(attributes file line)};
235 100 ▶ if ($attributes) {
Branch: 1 branch
BranchTrueFalseTotal
if ($attributes) 0 100 100
236 /\A\w+(?:\(.*\))?\z/s || croak "invalid attribute $_"
237 0 ▶ for @$attributes;
Branch: 1 branch
BranchTrueFalseTotal
/\A\w+(?:\(.*\))?\z/s or croak("invalid attribute $_") 0 0 0
238 }
239 my $quoted_info = {
240 name => $name,
241 code => $code,
242 captures => $captures,
243 package => (exists $options->{package} ? $options->{package} : $caller[0]),
244 hints => (exists $options->{hints} ? $options->{hints} : $caller[8]),
245 warning_bits => (exists $options->{warning_bits} ? $options->{warning_bits} : $caller[9]),
246 100 ▶ hintshash => (exists $options->{hintshash} ? $options->{hintshash} : $caller[10]),
Branch: 7 branches
BranchTrueFalseTotal
exists $options->{'package'} ? : 100 0 100
exists $options->{'hints'} ? : 0 100 100
exists $options->{'warning_bits'} ? : 0 100 100
exists $options->{'hintshash'} ? : 0 100 100
$attributes ? : 0 100 100
$file ? : 0 100 100
$line ? : 0 100 100
247 ($attributes ? (attributes => $attributes) : ()),
248 ($file ? (file => $file) : ()),
249 ($line ? (line => $line) : ()),
250 };
251 100 my $unquoted;
252 100 weaken($quoted_info->{unquoted} = \$unquoted);
253 100 ▶ if ($options->{no_defer}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($options->{'no_defer'}) { } 100 0 100
254 100 my $fake = \my $var;
255 100 local $QUOTED{$fake} = $quoted_info;
256 100 my $sub = unquote_sub($fake);
257 100 ▶ Sub::Defer::_install_coderef($name, $sub) if $name && !$options->{no_install};
Branch: 1 branch
BranchTrueFalseTotal
if $name and not $options->{"no_install"} 79 21 100
Condition66%2/3
$name and not $options->{"no_install"}
!ll&&!rl&&r
02179
MC/DC50%1/2
$name and not $options->{"no_install"}
$name not $options->{"no_install"}
Truth table66%2/3
A and not(B)
A= $nameB= not $options->{"no_install"}
ABresult
0X0
100
111
258 100 return $sub;
259 }
260 else {
261 my $deferred = defer_sub(
262 ($options->{no_install} ? undef : $name),
263 0 ▶ sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
264 0 $unquoted if 0;
265 0 unquote_sub($quoted_info->{deferred});
266 },
267 {
268 ($attributes ? ( attributes => $attributes ) : ()),
269 0 ▶ ($name ? () : ( package => $quoted_info->{package} )),
Branch: 3 branches
BranchTrueFalseTotal
$options->{'no_install'} ? : 0 0 0
$attributes ? : 0 0 0
$name ? : 0 0 0
270 },
271 );
272 0 weaken($quoted_info->{deferred} = $deferred);
273 0 weaken($QUOTED{$deferred} = $quoted_info);
274 0 return $deferred;
275 }
276 }
277  
278 100 ▶sub _context {
Subroutine _context: called CC=7 SCAR=28.0
279 100 my $info = shift;
280 100 ▶ $info->{context} ||= do {
Condition33%1/3
$info->{"context"} ||= do { () = @{$info;}{"package", "hints", "warning_bits", "hintshash", "file", "line"}; $line ||= 1 if $file; my $line_mark = ""; if ($line) { $line_mark = '#line ' . ($line - 1); if ($file) { $line_mark .= qq[ "$file"]; } ; $line_mark .= "\n"; } ; $info->{"context"} = "# BEGIN quote_sub PRELUDE\n" . "package $package;\n" . "BEGIN {\n" . " \$^H = " . quotify($hints) . ";\n" . " \${^WARNING_BITS} = " . quotify($warning_bits) . ";\n" . " %^H = (\n" . join("", map((' ' . quotify($_) . ' => ' . quotify($hintshash->{$_}) . ",\n"), grep((!(ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/)), keys %$hintshash))) . " );\n" . "}\n" . $line_mark . "# END quote_sub PRELUDE\n" }
l!l&&r!l&&!r
01000
MC/DC0%0/2
$info->{"context"} ||= do { () = @{$info;}{"package", "hints", "warning_bits", "hintshash", "file", "line"}; $line ||= 1 if $file; my $line_mark = ""; if ($line) { $line_mark = '#line ' . ($line - 1); if ($file) { $line_mark .= qq[ "$file"]; } ; $line_mark .= "\n"; } ; $info->{"context"} = "# BEGIN quote_sub PRELUDE\n" . "package $package;\n" . "BEGIN {\n" . " \$^H = " . quotify($hints) . ";\n" . " \${^WARNING_BITS} = " . quotify($warning_bits) . ";\n" . " %^H = (\n" . join("", map((' ' . quotify($_) . ' => ' . quotify($hintshash->{$_}) . ",\n"), grep((!(ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/)), keys %$hintshash))) . " );\n" . "}\n" . $line_mark . "# END quote_sub PRELUDE\n" }
$info->{"context"} do { () = @{$info;}{"package", "hints", "warning_bits", "hintshash", "file", "line"}; $line ||= 1 if $file; my $line_mark = ""; if ($line) { $line_mark = '#line ' . ($line - 1); if ($file) { $line_mark .= qq[ "$file"]; } ; $line_mark .= "\n"; } ; $info->{"context"} = "# BEGIN quote_sub PRELUDE\n" . "package $package;\n" . "BEGIN {\n" . " \$^H = " . quotify($hints) . ";\n" . " \${^WARNING_BITS} = " . quotify($warning_bits) . ";\n" . " %^H = (\n" . join("", map((' ' . quotify($_) . ' => ' . quotify($hintshash->{$_}) . ",\n"), grep((!(ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/)), keys %$hintshash))) . " );\n" . "}\n" . $line_mark . "# END quote_sub PRELUDE\n" }
Truth table33%1/3
A ||= B
A= $info->{"context"}B= do { () = @{$info;}{"package", "hints", "warning_bits", "hintshash", "file", "line"}; $line ||= 1 if $file; my $line_mark = ""; if ($line) { $line_mark = '#line ' . ($line - 1); if ($file) { $line_mark .= qq[ "$file"]; } ; $line_mark .= "\n"; } ; $info->{"context"} = "# BEGIN quote_sub PRELUDE\n" . "package $package;\n" . "BEGIN {\n" . " \$^H = " . quotify($hints) . ";\n" . " \${^WARNING_BITS} = " . quotify($warning_bits) . ";\n" . " %^H = (\n" . join("", map((' ' . quotify($_) . ' => ' . quotify($hintshash->{$_}) . ",\n"), grep((!(ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/)), keys %$hintshash))) . " );\n" . "}\n" . $line_mark . "# END quote_sub PRELUDE\n" }
ABresult
1X1
011
000
281 my ($package, $hints, $warning_bits, $hintshash, $file, $line)
282 100 = @{$info}{qw(package hints warning_bits hintshash file line)};
283  
284 100 ▶ $line ||= 1
Branch: 1 branch
BranchTrueFalseTotal
if $file 0 100 100
Condition0%0/2
$line ||= 1
l!l
00
MC/DC0%0/1
$line ||= 1
$line
Truth table0%0/2
A
A= $line
Aresult
11
00
285 if $file;
286  
287 100 my $line_mark = '';
288 100 ▶ if ($line) {
Branch: 1 branch
BranchTrueFalseTotal
if ($line) 0 100 100
289 0 $line_mark = "#line ".($line-1);
290 0 ▶ if ($file) {
Branch: 1 branch
BranchTrueFalseTotal
if ($file) 0 0 0
291 0 $line_mark .= qq{ "$file"};
292 }
293 0 $line_mark .= "\n";
294 }
295  
296 $info->{context}
297 ="# BEGIN quote_sub PRELUDE\n"
298 ."package $package;\n"
299 ."BEGIN {\n"
300 ." \$^H = ".quotify($hints).";\n"
301 ." \${^WARNING_BITS} = ".quotify($warning_bits).";\n"
302 ." \%^H = (\n"
303 . join('', map
304 " ".quotify($_)." => ".quotify($hintshash->{$_}).",\n",
305 100 ▶ grep !(ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/),
Condition0%0/3
ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/
!ll&&!rl&&r
000
MC/DC0%0/2
ref $hintshash->{$_} && $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/
ref $hintshash->{$_} $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/
Truth table0%0/3
A && B
A= ref $hintshash->{$_}B= $hintshash->{$_} =~ /\A(?:\w+(?:::\w+)*=)?[A-Z]+\(0x[[0-9a-fA-F]+\)\z/
ABresult
0X0
100
111
306 keys %$hintshash)
307 ." );\n"
308 ."}\n"
309 .$line_mark
310 ."# END quote_sub PRELUDE\n";
311 };
312 }
313  
314 25 ▶sub quoted_from_sub {
Subroutine quoted_from_sub: called CC=8 SCAR=38.6
Pod documented
315 25 my ($sub) = @_;
316 25 ▶ my $quoted_info = $QUOTED{$sub||''} or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $quoted_info = $Sub::Quote::QUOTED{$sub or ""} or return undef 0 25 25
Condition50%1/2
$sub || ''
l!l
250
MC/DC0%0/1
$sub || ''
$sub
Truth table50%1/2
A
A= $sub
Aresult
11
00
317 my ($name, $code, $captures, $unquoted, $deferred)
318 0 = @{$quoted_info}{qw(name code captures unquoted deferred)};
319 0 $code = _context($quoted_info) . $code;
320 0 ▶ $unquoted &&= $$unquoted;
Condition0%0/3
$unquoted &&= $$unquoted
!ll&&!rl&&r
000
MC/DC0%0/2
$unquoted &&= $$unquoted
$unquoted $$unquoted
Truth table0%0/3
A &&= B
A= $unquotedB= $$unquoted
ABresult
0X0
100
111
321 0 ▶ if (($deferred && $deferred eq $sub)
Branch: 1 branch
BranchTrueFalseTotal
if ($deferred and $deferred eq $sub or $unquoted and $unquoted eq $sub) 0 0 0
Condition0%0/9
$deferred and $deferred eq $sub or $unquoted and $unquoted eq $sub
l!l&&r!l&&!r
000
$deferred and $deferred eq $sub
!ll&&!rl&&r
000
$unquoted and $unquoted eq $sub
!ll&&!rl&&r
000
MC/DC0%0/4
$deferred and $deferred eq $sub or $unquoted and $unquoted eq $sub
$deferred $deferred eq $sub $unquoted $unquoted eq $sub
Truth table0%0/7
A and B or C and D
A= $deferredB= $deferred eq $subC= $unquotedD= $unquoted eq $sub
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
322 || ($unquoted && $unquoted eq $sub)) {
323 0 return [ $name, $code, $captures, $unquoted, $deferred ];
324 }
325 0 return undef;
326 }
327  
328 100 ▶sub unquote_sub {
Subroutine unquote_sub: called CC=20 SCAR=42.8
Pod documented
329 100 my ($sub) = @_;
330 100 ▶ my $quoted_info = $QUOTED{$sub} or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $quoted_info = $Sub::Quote::QUOTED{$sub} or return undef 100 0 100
331 100 my $unquoted = $quoted_info->{unquoted};
332 100 ▶ unless ($unquoted && $$unquoted) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($unquoted and $$unquoted) 100 0 100
Condition33%1/3
$unquoted and $$unquoted
!ll&&!rl&&r
01000
MC/DC0%0/2
$unquoted and $$unquoted
$unquoted $$unquoted
Truth table33%1/3
A and B
A= $unquotedB= $$unquoted
ABresult
0X0
100
111
333 my ($name, $code, $captures, $package, $attributes)
334 100 = @{$quoted_info}{qw(name code captures package attributes)};
335  
336 100 ▶ ($package, $name) = $name =~ /(.*)::(.*)/
Branch: 1 branch
BranchTrueFalseTotal
if $name 100 0 100
337 if $name;
338  
339 100 ▶ my %captures = $captures ? %$captures : ();
Branch: 1 branch
BranchTrueFalseTotal
$captures ? : 7 93 100
340 100 $captures{'$_UNQUOTED'} = \$unquoted;
341 100 $captures{'$_QUOTED'} = \$quoted_info;
342  
343 100 ▶ my $make_sub
Branch: 3 branches
BranchTrueFalseTotal
$name ? : 100 0 100
$attributes ? : 0 100 100
$name ? : 100 0 100
344 = "{\n"
345 . capture_unroll("\$_[1]", \%captures, 2)
346 . " package ${package};\n"
347 . (
348 $name
349 # disable the 'variable $x will not stay shared' warning since
350 # we're not letting it escape from this scope anyway so there's
351 # nothing trying to share it
352 ? " no warnings 'closure';\n sub ${name} "
353 : " \$\$_UNQUOTED = sub "
354 )
355 . ($attributes ? join('', map ":$_ ", @$attributes) : '') . "{\n"
356 . " (\$_QUOTED,\$_UNQUOTED) if 0;\n"
357 . _context($quoted_info)
358 . $code
359 . " }".($name ? "\n \$\$_UNQUOTED = \\&${name}" : '') . ";\n"
360 . "}\n"
361 . "1;\n";
362 100 ▶ if (my $debug = $ENV{SUB_QUOTE_DEBUG}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $debug = $ENV{"SUB_QUOTE_DEBUG"}) 0 100 100
363 0 ▶ if ($debug =~ m{^([^\W\d]\w*(?:::\w+)*(?:::)?)$}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($debug =~ /^([^\W\d]\w*(?:::\w+)*(?:::)?)$/) { } 0 0 0
elsif ($debug =~ m[\A/(.*)/\z]s) { } 0 0 0
364 0 my $filter = $1;
365 0 ▶ my $match
Branch: 2 branches
BranchTrueFalseTotal
$filter =~ /::$/ ? : 0 0 0
$filter =~ /::/ ? : 0 0 0
Condition0%0/4
$name || '__ANON__'
l!l
00
$name or "__ANON__"
l!l
00
MC/DC0%0/1
$name || '__ANON__'
$name
MC/DC0%0/1
$name or "__ANON__"
$name
Truth table0%0/2
A
A= $name
Aresult
11
00
Truth table0%0/2
A
A= $name
Aresult
11
00
366 = $filter =~ /::$/ ? $package.'::'
367 : $filter =~ /::/ ? $package.'::'.($name||'__ANON__')
368 : ($name||'__ANON__');
369 0 ▶ warn $make_sub
Branch: 1 branch
BranchTrueFalseTotal
if $match eq $filter 0 0 0
370 if $match eq $filter;
371 }
372 elsif ($debug =~ m{\A/(.*)/\z}s) {
373 0 my $filter = $1;
374 0 ▶ warn $make_sub
Branch: 1 branch
BranchTrueFalseTotal
if $code =~ /$filter/ 0 0 0
375 if $code =~ $filter;
376 }
377 else {
378 0 warn $make_sub;
379 }
380 }
381 {
382 7 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
383 100 ▶ local *{"${package}::${name}"} if $name;
Branch: 1 branch
BranchTrueFalseTotal
if $name 100 0 100
384 100 my ($success, $e);
385 {
386 100 local $@;
387 100 $success = _clean_eval($make_sub, \%captures);
388 100 $e = $@;
389 }
390 100 ▶ unless ($success) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($success) 0 100 100
391 0 my $space = length($make_sub =~ tr/\n//);
392 0 my $line = 0;
393 0 $make_sub =~ s/^/sprintf "%${space}d: ", ++$line/emg;
394 0 croak "Eval went very, very wrong:\n\n${make_sub}\n\n$e";
395 }
396 100 weaken($QUOTED{$$unquoted} = $quoted_info);
397 }
398 }
399 100 $$unquoted;
400 }
401  
402 0 ▶sub qsub ($) {
Subroutine qsub: not called CC=1 SCAR=6.9
Pod documented
403 0 goto &quote_sub;
404 }
405  
406 0 ▶sub CLONE {
Subroutine CLONE: not called CC=6 SCAR=37.4
407 0 my @quoted = map { defined $_ ? (
408 0 ▶ $_->{unquoted} && ${$_->{unquoted}} ? (${ $_->{unquoted} } => $_) : (),
Branch: 1 branch
BranchTrueFalseTotal
$_->{'deferred'} ? : 0 0 0
409 0 ▶ $_->{deferred} ? ($_->{deferred} => $_) : (),
Branch: 2 branches
BranchTrueFalseTotal
defined $_ ? : 0 0 0
$_->{'unquoted'} && ${$_->{'unquoted'};} ? : 0 0 0
Condition0%0/3
$_->{"unquoted"} and ${$_->{"unquoted"};}
!ll&&!rl&&r
000
MC/DC0%0/2
$_->{"unquoted"} and ${$_->{"unquoted"};}
$_->{"unquoted"} ${$_->{"unquoted"};}
Truth table0%0/3
A and B
A= $_->{"unquoted"}B= ${$_->{"unquoted"};}
ABresult
0X0
100
111
410 ) : () } values %QUOTED;
411 0 %QUOTED = @quoted;
412 0 weaken($_) for values %QUOTED;
413 }
414  
415 7 1;
416 __END__
« /usr/local/lib/perl5/site_perl/5.44.0/Pod/Coverage.pm ↑ Summary lib/Skilletor/Resolver.pm »