line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::String::replace; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2205'; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
2049
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
99
|
|
5
|
3
|
|
|
3
|
|
21
|
use warnings; |
|
3
|
|
|
|
|
30
|
|
|
3
|
|
|
|
|
89
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
18
|
use Moose::Util (); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
38
|
|
8
|
3
|
|
|
3
|
|
29
|
use Params::Util (); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
51
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
50
|
use Moose::Role; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
27
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Writer'; |
13
|
|
|
|
|
|
|
|
14
|
15
|
|
|
15
|
|
53
|
sub _minimum_arguments { 1 } |
15
|
|
|
|
|
|
|
|
16
|
15
|
|
|
15
|
|
49
|
sub _maximum_arguments { 2 } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _inline_check_arguments { |
19
|
15
|
|
|
15
|
|
36
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
return ( |
22
|
15
|
|
|
|
|
58
|
'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
|
|
43
|
my $self = shift; |
45
|
15
|
|
|
|
|
40
|
my ($slot_access) = @_; |
46
|
|
|
|
|
|
|
|
47
|
15
|
|
|
|
|
74
|
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
|
|
14
|
my $self = shift; |
58
|
7
|
|
|
|
|
25
|
my ($inv, $new, $slot_access) = @_; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
return ( |
61
|
7
|
|
|
|
|
47
|
'ref $_[1]', |
62
|
|
|
|
|
|
|
'? ' . $slot_access . ' =~ s/$_[0]/$_[1]->()/e', |
63
|
|
|
|
|
|
|
': ' . $slot_access . ' =~ s/$_[0]/$_[1]/;', |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
3
|
|
|
3
|
|
34
|
no Moose::Role; |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
30
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |