line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor::Native::String::replace; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2203'; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
1815
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
95
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
78
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
16
|
use Moose::Util (); |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
39
|
|
8
|
3
|
|
|
3
|
|
15
|
use Params::Util (); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
53
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
16
|
use Moose::Role; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
26
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Moose::Meta::Method::Accessor::Native::Writer'; |
13
|
|
|
|
|
|
|
|
14
|
15
|
|
|
15
|
|
45
|
sub _minimum_arguments { 1 } |
15
|
|
|
|
|
|
|
|
16
|
15
|
|
|
15
|
|
41
|
sub _maximum_arguments { 2 } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _inline_check_arguments { |
19
|
15
|
|
|
15
|
|
35
|
my $self = shift; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
return ( |
22
|
15
|
|
|
|
|
57
|
'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
|
|
26
|
my $self = shift; |
45
|
15
|
|
|
|
|
32
|
my ($slot_access) = @_; |
46
|
|
|
|
|
|
|
|
47
|
15
|
|
|
|
|
62
|
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
|
|
12
|
my $self = shift; |
58
|
7
|
|
|
|
|
19
|
my ($inv, $new, $slot_access) = @_; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
return ( |
61
|
7
|
|
|
|
|
55
|
'ref $_[1]', |
62
|
|
|
|
|
|
|
'? ' . $slot_access . ' =~ s/$_[0]/$_[1]->()/e', |
63
|
|
|
|
|
|
|
': ' . $slot_access . ' =~ s/$_[0]/$_[1]/;', |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
3
|
|
|
3
|
|
22
|
no Moose::Role; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
14
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |