| 1 | 34 | ▶ | use 5.014; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 34 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 34 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 34 | ▶ | no warnings 'void'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 34 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 34 | ▶ | use Exporter::Tiny (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 34 | ▶ | use PadWalker (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 34 | ▶ | use Parse::Keyword (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 34 | ▶ | use Module::Runtime (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 34 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 34 | ▶ | use Sub::Util (); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | package Kavorka; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 38 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 38 | our $VERSION = '0.039'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 38 | our @ISA = qw( Exporter::Tiny ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 38 | our @EXPORT = qw( fun method ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 38 | our @EXPORT_OK = qw( fun method after around before override augment classmethod objectmethod multi ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 38 | our %EXPORT_TAGS = ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | modifiers => [qw( after around before )], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | allmodifiers => [qw( after around before override augment )], | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 38 | our %IMPLEMENTATION = ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | after => 'Kavorka::Sub::After', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | around => 'Kavorka::Sub::Around', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | augment => 'Kavorka::Sub::Augment', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | before => 'Kavorka::Sub::Before', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | classmethod => 'Kavorka::Sub::ClassMethod', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | f => 'Kavorka::Sub::Fun', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | fun => 'Kavorka::Sub::Fun', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | func => 'Kavorka::Sub::Fun', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | function => 'Kavorka::Sub::Fun', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | method => 'Kavorka::Sub::Method', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | multi => 'Kavorka::Multi', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | objectmethod => 'Kavorka::Sub::ObjectMethod', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | override => 'Kavorka::Sub::Override', | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 38 | our %INFO; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | sub info | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 16 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 16 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 16 | my $code = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 16 | $INFO{$code}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | sub guess_implementation | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 297 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
guess_implementation: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 297 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 297 | $IMPLEMENTATION{$_[0]}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | sub compose_implementation | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
compose_implementation: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | require Moo::Role; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | Moo::Role->create_class_with_roles(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | sub _exporter_validate_opts | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 81 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_exporter_validate_opts: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 81 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 81 | $^H{'Kavorka/package'} = $_[0]{into}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 81 | ▶ | $_[0]{replace} = 1 unless exists $_[0]{replace}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | sub _fqname ($;$) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 164 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_fqname: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 164 | my $name = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 164 | my ($package, $subname); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 164 | $name =~ s{'}{::}g; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 164 | ▶ | if ($name =~ /::/) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 5 | ($package, $subname) = $name =~ m{^(.+)::(\w+)$}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 159 | ▶ | my $caller = @_ ? shift : $^H{'Kavorka/package'}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 159 | ($package, $subname) = ($caller, $name); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 164 | ▶ | return wantarray ? ($package, $subname) : "$package\::$subname"; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | sub _exporter_fail | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 298 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_exporter_fail: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 298 | my $me = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 298 | my ($name, $args, $globals) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | my $implementation = | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 298 | ▶ | $args->{'implementation'} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%3/6
($args->{"implementation"} // $me->guess_implementation($name)) // $me
$args->{"implementation"} // $me->guess_implementation($name)
MC/DC0%0/3
($args->{"implementation"} // $me->guess_implementation($name)) // $me
$args->{"implementation"}
$me->guess_implementation($name)
$me
Truth table50%2/4
A // B // C
A= $args->{"implementation"}B= $me->guess_implementation($name)C= $me
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | // $me->guess_implementation($name) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | // $me; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 298 | my $into = $globals->{into}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 298 | Module::Runtime::use_package_optimistically($implementation); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 298 | ▶ | my $traits = $globals->{traits} // $args->{traits}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$globals->{"traits"} // $args->{"traits"}
MC/DC50%1/2
$globals->{"traits"} // $args->{"traits"}
$globals->{"traits"}
$args->{"traits"}
Truth table66%2/3
A // B
A= $globals->{"traits"}B= $args->{"traits"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 298 | ▶ | $implementation = $me->compose_implementation($implementation, @$traits) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | if $traits; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 298 | ▶ | $implementation->can('parse') | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | or Carp::croak("No suitable implementation for keyword '$name'"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | # Workaround for RT#95786 which might be caused by a bug in the Perl | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | # interpreter. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | # Also RT#98666 is why we can't just call undefer_all. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 298 | require Sub::Defer; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 298 | for (keys %Sub::Defer::DEFERRED) { | |||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 38 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | Sub::Defer::undefer_sub($_) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 11101 | ▶ | if $Sub::Defer::DEFERRED{$_} && $Sub::Defer::DEFERRED{$_}[0] =~ /\AKavorkaX?\b/; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$Sub::Defer::DEFERRED{$_} and $Sub::Defer::DEFERRED{$_}[0] =~ /\AKavorkaX?\b/u
MC/DC100%2/2
$Sub::Defer::DEFERRED{$_} and $Sub::Defer::DEFERRED{$_}[0] =~ /\AKavorkaX?\b/u
$Sub::Defer::DEFERRED{$_}
$Sub::Defer::DEFERRED{$_}[0] =~ /\AKavorkaX?\b/u
Truth table100%3/3
A and B
A= $Sub::Defer::DEFERRED{$_}B= $Sub::Defer::DEFERRED{$_}[0] =~ /\AKavorkaX?\b/u
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | # Kavorka::Multi (for example) needs to know what Kavorka keywords are | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | # currently in scope. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 298 | $^H{'Kavorka'} .= "$name=$implementation "; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | # This is the code that gets called at run-time. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | my $code = Sub::Util::set_subname( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | "$me\::$name", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 42 | ▶ | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=8 SCAR=20.8
Subroutine
method: called CC=8 SCAR=20.8
Subroutine
fun: called CC=8 SCAR=20.8
Subroutine
before: called CC=8 SCAR=20.8
Subroutine
after: called CC=8 SCAR=20.8
Subroutine
multi: called CC=8 SCAR=20.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 42 | ▶ | unless (Scalar::Util::blessed($_[0]) and $_[0]->DOES('Kavorka::Sub')) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
builtin::blessed($_[0]) and $_[0]->DOES("Kavorka::Sub")
builtin::blessed($_[0]) and $_[0]->DOES("Kavorka::Sub")
MC/DC0%0/2
builtin::blessed($_[0]) and $_[0]->DOES("Kavorka::Sub")
builtin::blessed($_[0])
$_[0]->DOES("Kavorka::Sub")
MC/DC50%1/2
builtin::blessed($_[0]) and $_[0]->DOES("Kavorka::Sub")
builtin::blessed($_[0])
$_[0]->DOES("Kavorka::Sub")
Truth table33%1/3
A and B
A= builtin::blessed($_[0])B= $_[0]->DOES("Kavorka::Sub")
Truth table66%2/3
A and B
A= builtin::blessed($_[0])B= $_[0]->DOES("Kavorka::Sub")
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | return $implementation->bypass_custom_parsing($name, $into, \@_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 42 | my $subroutine = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | # Post-parse clean-up | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 42 | $subroutine->_post_parse(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | # Store $subroutine for introspection | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 42 | $INFO{ $subroutine->body } = $subroutine; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | # Install sub | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 42 | ▶ | my @r = wantarray | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | ? $subroutine->install_sub | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | : scalar($subroutine->install_sub); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | # Workarounds for closure issues in Parse::Keyword | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 42 | ▶ | if ($subroutine->is_anonymous) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 5 | my $orig = $r[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 5 | my $caller_vars = PadWalker::peek_my(1); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 50 | ▶ | @r = Sub::Util::set_subname($subroutine->package."::__ANON__", sub { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 50 | $subroutine->_poke_pads($caller_vars); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 50 | goto $orig; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 5 | }); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 5 | &Scalar::Util::set_prototype($r[0], $_) for grep defined, prototype($orig); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 5 | $INFO{ $r[0] } = $subroutine; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 5 | Scalar::Util::weaken($INFO{ $r[0] }); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | else | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 37 | $subroutine->_poke_pads( PadWalker::peek_my(1) ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | # Prevents a cycle between %INFO and $subroutine. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | Scalar::Util::weaken($subroutine->{body}) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 42 | ▶ | unless Scalar::Util::isweak($subroutine->{body}); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 42 | ▶ | wantarray ? @r : $r[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 298 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | # This joins up the code above with our custom parsing via | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | # Parse::Keyword | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | Parse::Keyword::install_keyword_handler( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | $code => Sub::Util::set_subname( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | "$me\::parse_$name", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 188 | ▶ | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 188 | local $Carp::CarpLevel = $Carp::CarpLevel + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 188 | my $subroutine = $implementation->parse(keyword => $name); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 196 | ▶ | sub { ($subroutine, $args) }, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 188 | !! $subroutine->declared_name, | |||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 298 | ), | |||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | # Symbol for Exporter::Tiny to export | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 298 | return ($name => $code); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 38 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||