File Coverage

blib/lib/Acme/Backwards.pm
Criterion Covered Total %
statement 81 132 61.3
branch 7 12 58.3
condition 7 18 38.8
subroutine 13 13 100.0
pod n/a
total 108 175 61.7


line stmt bran cond sub pod time code
1             package Acme::Backwards;
2             our $VERSION = '1.01';
3 3     3   372194 use Keyword::Declare;
  3         626230  
  3         41  
4 3     3   63 sub import {
  0         0  
5 3     3   235882 keytype OKAY is m{(?:fisle (?&PerlNWS)(?&PerlExpression).*?;|esle (?&PerlNWS).*?;)?+}xms;
  3         5  
6 0 50 50 3   0 keyword rof (/(my\s*\$\w+)?/ $declare, Expr $test, /.+?;$/ $code) {_backwards('for', ($declare ? $declare : ()), $test, $code);};
  0         0  
  0         0  
  3         47  
  3         428366  
  3         8  
  3         8  
  3         73  
7 0 50 50 4   0 keyword fi (Expr $test, /.+?;/ $code, OKAY @next) {_backwards('if', $test, $code)._process_backwards(@next);};
  0         0  
  0         0  
  0         0  
  3         18  
  3         9  
  3         31  
  4         553021  
  4         9  
  4         9  
  3         74  
8 0 50 50 1   0 keyword sselnu (Expr $test, /.+?;/ $code, OKAY @next) {_backwards('unless', $test, $code)._process_backwards(@next);};
  0         0  
  0         0  
  0         0  
  0         0  
  3         84  
  3         17  
  4         12  
  3         44  
  1         99215  
  1         2  
  1         2  
9 0         0 }
  0         0  
  4         105  
  3         17  
  1         2  
10 0     5   0 sub _process_backwards {join' ',map{$_=~m/(fisle|esle)(.*)$/;return"_$1"->($2)}@_;}
  0         0  
  0         0  
  3         136  
  3         9  
  1         128  
  5         74  
  3         37  
  3         35  
11 0     2   0 sub _esle {_backwards('else','',shift)}
  0         0  
  0         0  
  3         9  
  4         134  
  4         12  
  2         10  
12 0     1   0 sub _fisle {shift=~m/\s*((?&PerlExpression))\s*(.*?;) $PPR::GRAMMAR/gxm;_backwards('elsif', $1, $2);}
  0         0  
  0         0  
  0         0  
  3         103  
  4         1032  
  1         52  
  1         4  
  1         66568  
  1         616  
13 0 100   11   0 sub _backwards {scalar@_>3?sprintf"%s %s %s { %s }",@_:sprintf"%s %s { %s }",@_;}
  0         0  
  4         114  
  1         201  
  11         199  
14 0         0  
  0         0  
  0         0  
  3         237  
  3         7  
  1         31  
15 0         0 1;
  0         0  
  0         0  
  3         1323  
  4         63  
  4         6  
16 0         0  
  0         0  
  0         0  
  0         0  
  3         277  
  4         10  
  1         20  
  1         2  
17 0   0     0 __END__