lib/Text/Xatena/Node/Comment.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.4% 34 / 36 CC 3 SCAR 5.6
CC
3
Cov
100%
parse
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« blib/lib/Text/Xatena/Inline/Base.pm ↑ Summary lib/Text/Xatena/Inline/Aggressive.pm »
1 package Text::Xatena::Node::Comment;
2  
3 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 19 ▶use base qw(Text::Xatena::Node);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 19 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 BEGINNING => qr/^(.*)<!--.*?(-->)?$/,
8 ENDOFNODE => qr/^-->$/,
9 19 };
10  
11 276 ▶sub parse {
Subroutine parse: called CC=3 SCAR=11.0
Pod undocumented
12 276 my ($class, $s, $parent, $stack) = @_;
13 276 ▶ if ($s->scan(BEGINNING)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s->scan(qr/^(.*)<!--.*?(-->)?$/)) 8 268 276
14 8 my $pre = $s->matched->[1];
15 8 push @$parent, $pre;
16 8 ▶ unless ($s->matched->[2]) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($s->matched->[2]) 4 4 8
17 4 $s->scan_until(ENDOFNODE);
18 }
19  
20 8 my $node = $class->new;
21 8 push @$parent, $node;
22 8 return 1;
23 }
24 }
25  
26 8 ▶sub as_html {
Subroutine as_html: called CC=1 SCAR=0.0
Pod undocumented
27 8 my ($self, $context, %opts) = @_;
28 8 '<!-- -->';
29 }
30  
31 19 1;
32 __END__
« blib/lib/Text/Xatena/Inline/Base.pm ↑ Summary lib/Text/Xatena/Inline/Aggressive.pm »