line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Babble::SubMatch; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
158
|
use Mu; |
|
12
|
|
|
|
|
28
|
|
|
12
|
|
|
|
|
123
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends 'Babble::Match'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
ro 'parent'; |
8
|
|
|
|
|
|
|
ro 'start'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub replace_text { |
11
|
178
|
|
|
178
|
0
|
388766
|
my ($self, $new_text) = @_; |
12
|
178
|
|
|
|
|
4472
|
$self->replace_substring(0, length($self->text), $new_text); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub transform_text { |
16
|
32
|
|
|
32
|
0
|
113
|
my ($self, $code) = @_; |
17
|
32
|
|
|
|
|
137
|
local $_ = my $text = $self->text; |
18
|
32
|
|
|
|
|
125
|
$code->($_); |
19
|
32
|
50
|
|
|
|
301
|
if ($_ ne $text) { $self->replace_text($_) } |
|
32
|
|
|
|
|
106
|
|
20
|
32
|
|
|
|
|
551
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
before replace_substring => sub { |
24
|
|
|
|
|
|
|
my ($self, $start, $length, $new_text) = @_; |
25
|
|
|
|
|
|
|
$self->parent |
26
|
|
|
|
|
|
|
->replace_substring($self->start + $start, $length, $new_text); |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |