line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::String::replace; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2206'; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
2414
|
use strict; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
114
|
|
5
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
98
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
26
|
use Moose::Util (); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
59
|
|
8
|
3
|
|
|
3
|
|
17
|
use Params::Util (); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
48
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
16
|
use Moose::Role; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
33
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Writer'; |
13
|
|
|
|
|
|
|
|
14
|
15
|
|
|
15
|
|
66
|
sub _minimum_arguments { 1 } |
15
|
|
|
|
|
|
|
|
16
|
15
|
|
|
15
|
|
56
|
sub _maximum_arguments { 2 } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _inline_check_arguments { |
19
|
15
|
|
|
15
|
|
37
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
return ( |
22
|
15
|
|
|
|
|
54
|
'if (!Moose::Util::_STRINGLIKE0($_[0]) && !Params::Util::_REGEX($_[0])) {', |
23
|
|
|
|
|
|
|
$self->_inline_throw_exception( InvalidArgumentToMethod => |
24
|
|
|
|
|
|
|
'argument => $_[0],'. |
25
|
|
|
|
|
|
|
'method_name => "replace",'. |
26
|
|
|
|
|
|
|
'ordinal => "first",'. |
27
|
|
|
|
|
|
|
'type_of_argument => "string or regexp reference",'. |
28
|
|
|
|
|
|
|
'type => "Str|RegexpRef"', |
29
|
|
|
|
|
|
|
) . ';', |
30
|
|
|
|
|
|
|
'}', |
31
|
|
|
|
|
|
|
'if (!Moose::Util::_STRINGLIKE0($_[1]) && !Params::Util::_CODELIKE($_[1])) {', |
32
|
|
|
|
|
|
|
$self->_inline_throw_exception( InvalidArgumentToMethod => |
33
|
|
|
|
|
|
|
'argument => $_[1],'. |
34
|
|
|
|
|
|
|
'method_name => "replace",'. |
35
|
|
|
|
|
|
|
'ordinal => "second",'. |
36
|
|
|
|
|
|
|
'type_of_argument => "string or code reference",'. |
37
|
|
|
|
|
|
|
'type => "Str|CodeRef"', |
38
|
|
|
|
|
|
|
) . ';', |
39
|
|
|
|
|
|
|
'}', |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _potential_value { |
44
|
15
|
|
|
15
|
|
36
|
my $self = shift; |
45
|
15
|
|
|
|
|
41
|
my ($slot_access) = @_; |
46
|
|
|
|
|
|
|
|
47
|
15
|
|
|
|
|
85
|
return '(do { ' |
48
|
|
|
|
|
|
|
. 'my $val = ' . $slot_access . '; ' |
49
|
|
|
|
|
|
|
. 'ref $_[1] ' |
50
|
|
|
|
|
|
|
. '? $val =~ s/$_[0]/$_[1]->()/e ' |
51
|
|
|
|
|
|
|
. ': $val =~ s/$_[0]/$_[1]/; ' |
52
|
|
|
|
|
|
|
. '$val; ' |
53
|
|
|
|
|
|
|
. '})'; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _inline_optimized_set_new_value { |
57
|
7
|
|
|
7
|
|
29
|
my $self = shift; |
58
|
7
|
|
|
|
|
26
|
my ($inv, $new, $slot_access) = @_; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
return ( |
61
|
7
|
|
|
|
|
59
|
'ref $_[1]', |
62
|
|
|
|
|
|
|
'? ' . $slot_access . ' =~ s/$_[0]/$_[1]->()/e', |
63
|
|
|
|
|
|
|
': ' . $slot_access . ' =~ s/$_[0]/$_[1]/;', |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
3
|
|
|
3
|
|
27
|
no Moose::Role; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
15
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |