blib/lib/Perl6/Interpolators.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 36 / 36 CC 3 SCAR 5.6
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
↑ Summary
1 package Perl6::Interpolators;
2
3 1 ▶use 5.6.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 1 our $VERSION = '0.03';
8
9 1 ▶use Text::Balanced qw(extract_codeblock);
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 1 ▶use Filter::Simple sub {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=3 SCAR=11.0
12 1 my($inside_stuff, $t, $pos);
13
14 1 ▶ while(($pos=index($_, '$(')) != -1) {
Branch: 1 branch
BranchTrueFalseTotal
if (($pos = index($_, "\$(")) != -1) 4 1 5
15 4 $t=substr($_, $pos);
16 4 $inside_stuff=extract_codeblock($t, '()', qr/\$/);
17
18 4 s<\$\Q$inside_stuff\E><\${\\scalar$inside_stuff}>
19 }
20
21 1 ($inside_stuff, $t, $pos)=(undef, undef, undef);
22
23 1 ▶ while(($pos=index($_, '@(')) != -1) {
Branch: 1 branch
BranchTrueFalseTotal
if (($pos = index($_, "\@(")) != -1) 3 1 4
24 3 $t=substr($_, $pos);
25 3 $inside_stuff=extract_codeblock($t, '()', qr/\@/);
26
27 3 s<\@\Q$inside_stuff\E><\@{[$inside_stuff]}>
28 }
29 1 };
30
31 1 1;
32
33 __END__
↑ Summary