File Coverage

blib/lib/Acme/Backwards.pm
Criterion Covered Total %
statement 59 95 62.1
branch 2 4 50.0
condition 6 16 37.5
subroutine 11 11 100.0
pod n/a
total 78 126 61.9


line stmt bran cond sub pod time code
1             package Acme::Backwards;
2             our $VERSION = '0.03';
3 2     2   117599 use Keyword::Declare;
  2         193545  
  2         25  
4 2     2   22 sub import {
  0         0  
5 2     2   48354 keytype OKAY is m{(?:fisle (?&PerlNWS)(?&PerlExpression).*?;|esle (?&PerlNWS).*?;)?+}xms;
  2         4  
6 0 50 50 3   0 keyword fi (Expr $test, /.+?;/ $code, OKAY @next) {_backwards('if', $test, $code)._process_backwards(@next);};
  0         0  
  0         0  
  2         35  
  3         159068  
  3         6  
  3         8  
  2         42  
7 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  
  2         9  
  3         8  
  2         18  
  1         53183  
  1         3  
  1         2  
8 0         0 }
  0         0  
  3         55  
  2         8  
  1         4  
9 0     4   0 sub _process_backwards {join' ',map{$_=~m/(fisle|esle)(.*)$/;return"_$1"->($2)}@_;}
  1         17  
  4         62  
  2         27  
  2         26  
10 0     1   0 sub _esle {_backwards('else','',shift)}
  0         0  
  3         98  
  3         7  
  1         6  
11 0     1   0 sub _fisle {shift=~m/\s*((?&PerlExpression))\s*(.*?;) $PPR::GRAMMAR/gxm;_backwards('elsif', $1, $2);}
  0         0  
  0         0  
  3         738  
  1         31  
  1         3  
  1         24235  
  1         298  
12 0     6   0 sub _backwards {sprintf"%s %s { %s }",@_;}
  0         0  
  3         36  
  1         246  
  6         160  
13 0         0 1;
  1         13  
14 0         0 __END__