blib/lib/Text/MicroMason/ServerPages.pm

filter: Statementstmt 100% 14 / 14 Branchbran 62.5% 5 / 8 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 90.0% 27 / 30 CC 6 SCAR 15.7
CC
6
Cov
88%
lex_token
6.7
BEGIN
1.0
BEGIN
1.0
CRAP 4.8
« blib/lib/Text/MicroMason/Filters.pm ↑ Summary blib/lib/Text/MicroMason/PostProcess.pm »
1 package Text::MicroMason::ServerPages;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Safe;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 ######################################################################
9  
10 1 my %block_types = (
11 '' => 'perl', # <% perl statements %>
12 '=' => 'expr', # <%= perl expression %>
13 '--' => 'doc', # <%-- this text will not appear in the output --%>
14 '&' => 'file', # <%& filename argument %>
15 );
16  
17 1 my $re_eol = "(?:\\r\\n|\\r|\\n|\\z)";
18 1 my $re_tag = "perl|args|once|init|cleanup|doc|text|expr|file";
19  
20 51 ▶sub lex_token {
Subroutine lex_token: called CC=6 SCAR=19.1
Pod documented
21 # Blocks in <%word> ... <%word> tags.
22 /\G \<\%($re_tag)\> (.*?) \<\/\%\1\> $re_eol? /xcogs ? ( $1 => $2 ) :
23
24 # Blocks in <% ... %> tags.
25 51 ▶ /\G \<\% (\=|\&)? ( .*? ) \%\> /gcxs ? ( $block_types{$1 || ''} => $2 ) :
Branch: 4 branches
BranchTrueFalseTotal
m[\G \<\%($re_tag)\> (.*?) \</\%\1\> $re_eol? ]cgosx ? : 0 51 51
/\G \<\% (\=|\&)? ( .*? ) \%\> /cgsx ? : 15 36 51
/\G \<\% \-\- ( .*? ) \-\- \%\> /cgsx ? : 0 36 36
/\G ( (?: [^\<]+ | \<(?!\%) )? ) /cgsx ? : 36 0 36
Condition100%2/2
$1 || ''
l!l
69
MC/DC100%1/1
$1 || ''
$1
Truth table100%2/2
A
A= $1
Aresult
11
00
26
27 # Blocks in <%-- ... --%> tags.
28 /\G \<\% \-\- ( .*? ) \-\- \%\> /gcxs ? ( 'doc' => $1 ) :
29
30 # Things that don't match the above
31 /\G ( (?: [^\<]+ | \<(?!\%) )? ) /gcxs ? ( 'text' => $1 ) :
32  
33 # Lexer error
34 ()
35 }
36  
37 ######################################################################
38  
39 1 1;
40  
41 __END__
« blib/lib/Text/MicroMason/Filters.pm ↑ Summary blib/lib/Text/MicroMason/PostProcess.pm »