QBit/Gettext/Extract/Lang/TT2.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 26 CC 1 SCAR 6.9
CC
1
Cov
0%
clean
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package QBit::Gettext::Extract::Lang::TT2;
2 $QBit::Gettext::Extract::Lang::TT2::VERSION = '0.005';
3 use qbit;
4  
5 use base qw(QBit::Gettext::Extract::Lang);
6  
7 my $RE_quoted_str = $QBit::Gettext::Extract::Lang::RE_quoted_str;
8  
9 sub clean {
10 my ($self, $text) = @_;
11  
12 my $new_text = '';
13 while ($text =~ /(.*?\[%)(.*?)%]/sg) {
14 my ($prev, $code) = ($1, $2);
15  
16 $prev =~ s/^.*$//mg; # Remove template text (outer [% ... %])
17 {
18 no warnings qw(uninitialized);
19 $code =~ s/($RE_quoted_str)|#.*$/$1/mg; # Remove comments
20 }
21  
22 $new_text .= $prev . $code;
23 }
24  
25 return $new_text;
26 }
27  
28 TRUE;