lib/Text/Xatena/Node/StopP.pm

filter: Statementstmt 100% 27 / 27 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 93.0% 40 / 43 CC 5 SCAR 11.0
CC
5
Cov
97%
parse
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/Text/Xatena.pm ↑ Summary lib/Text/Xatena/Node/Blockquote.pm »
1 package Text::Xatena::Node::StopP;
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 400 ▶sub parse {
Subroutine parse: called CC=5 SCAR=16.1
Pod undocumented
12 400 my ($class, $s, $parent, $stack) = @_;
13 400 ▶ if ($s->scan(BEGINNING)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s->scan(qr/^>(<.+>)(<)?$/)) 7 393 400
14 7 my $node = $class->new([ $s->matched->[1] ]);
15 7 push @$parent, $node;
16 7 ▶ if (!$s->matched->[2]) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($s->matched->[2]) 2 5 7
17 2 push @$stack, $node;
18 }
19 7 return 1;
20 }
21  
22 393 ▶ if ($s->scan(ENDOFNODE)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s->scan(qr/^(.+>)<$/)) 2 391 393
23 2 my $node = pop @$stack;
24 2 push @$node, $s->matched->[1];
25 2 ▶ ref($node) eq $class or warn sprintf("syntax error: unmatched syntax got:%s expected:%s", ref($node), $class);
Branch: 1 branch
BranchTrueFalseTotal
ref $node eq $class or warn sprintf('syntax error: unmatched syntax got:%s expected:%s', ref $node, $class) 2 0 2
26 2 return 1;
27 }
28 }
29  
30 9 ▶sub as_html {
Subroutine as_html: called CC=1 SCAR=0.0
Pod undocumented
31 9 my ($self, $context, %opts) = @_;
32 9 $self->SUPER::as_html($context, %opts, stopp => 1);
33 }
34  
35 19 1;
36 __END__
« blib/lib/Text/Xatena.pm ↑ Summary lib/Text/Xatena/Node/Blockquote.pm »