File Coverage

blib/lib/Devel/Chitin/OpTree/COP.pm
Criterion Covered Total %
statement 18 18 100.0
branch 6 6 100.0
condition 12 12 100.0
subroutine 4 4 100.0
pod 0 1 0.0
total 40 41 97.5


line stmt bran cond sub pod time code
1             package Devel::Chitin::OpTree::COP;
2 35     35   173 use base 'Devel::Chitin::OpTree';
  35         54  
  35         2973  
3              
4             our $VERSION = '0.16';
5              
6 35     35   169 use strict;
  35         54  
  35         582  
7 35     35   147 use warnings;
  35         66  
  35         6371  
8              
9             sub pp_nextstate {
10 1052     1052 0 1663 my $self = shift;
11              
12 1052         1515 my @package_and_label;
13              
14 1052         2407 my $cur_cop = $self->_get_cur_cop;
15 1052 100 100     2944 if ($cur_cop and !$self->is_null and $self->op->stashpv ne $cur_cop->op->stashpv) {
      100        
16 2         6 push @package_and_label, 'package ' . $self->op->stashpv . ';';
17             }
18              
19 1052 100 100     2612 if (!$self->is_null and my $label = $self->op->label) {
20 2         10 push @package_and_label, "$label:";
21             }
22              
23 1052 100 100     3620 $self->_set_cur_cop if (!$cur_cop or !$self->is_null);
24              
25 1052         3721 join(";\n", @package_and_label);
26             }
27             *pp_dbstate = \&pp_nextstate;
28             *pp_setstate = \&pp_nextstate;
29              
30             1;
31              
32             __END__