line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Cut; |
2
|
2
|
|
|
2
|
|
781
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
3
|
2
|
|
|
2
|
|
8
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
4
|
2
|
|
|
2
|
|
45
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
5
|
2
|
|
|
2
|
|
13
|
use parent 'DTL::Fast::Filter'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{cut} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
110
|
use DTL::Fast::Variable; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
254
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#@Override |
13
|
|
|
|
|
|
|
sub parse_parameters |
14
|
|
|
|
|
|
|
{ |
15
|
4
|
|
|
4
|
0
|
8
|
my $self = shift; |
16
|
|
|
|
|
|
|
die $self->get_parse_error("no substitute specified for removing") |
17
|
4
|
50
|
|
|
|
6
|
if (not scalar @{$self->{parameter}}); |
|
4
|
|
|
|
|
10
|
|
18
|
4
|
|
|
|
|
9
|
$self->{remove} = $self->{parameter}->[0]; |
19
|
4
|
|
|
|
|
11
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#@Override |
23
|
|
|
|
|
|
|
sub filter |
24
|
|
|
|
|
|
|
{ |
25
|
4
|
|
|
4
|
0
|
9
|
my ($self, $filter_manager, $value, $context) = @_; |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
13
|
my $remove = $self->{remove}->render($context); |
28
|
4
|
|
|
|
|
52
|
$value =~ s/\Q$remove\E//gs; |
29
|
|
|
|
|
|
|
|
30
|
4
|
|
|
|
|
14
|
return $value; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |