TokenStream/Role/Stream.pm

filter: Statementstmt 77.2% 17 / 22 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 74.2% 26 / 35 CC 4 SCAR 11.0
CC
4
Cov
71%
collect_all
6.0
collect_upto
3.0
BEGIN
1.0
CRAP 3.0
↑ Summary TokenStream.pm »
1 package Text::TokenStream::Role::Stream;
2  
3 1 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.04';
7  
8 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 requires qw(
11 current_position
12 err
13 fill
14 looking_at
15 next
16 next_of
17 peek
18 skip_optional
19 token_err
20 );
21  
22 0 ▶sub collect_all {
Subroutine collect_all: not called CC=2 SCAR=17.9
Pod documented
23 0 my ($self) = @_;
24  
25 0 my @ret;
26 0 ▶ while (my $tok = $self->next) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $tok = $self->next) 0 0 0
27 0 push @ret, $tok;
28 }
29  
30 0 return @ret;
31 }
32  
33 1 ▶sub collect_upto {
Subroutine collect_upto: called CC=3 SCAR=11.0
Pod documented
34 1 my ($self, $target) = @_;
35  
36 1 my @ret;
37 1 ▶ while (my $tok = $self->peek) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $tok = $self->peek) 4 0 4
38 4 ▶ last if $tok->matches($target);
Branch: 1 branch
BranchTrueFalseTotal
if $tok->matches($target) 1 3 4
39 3 push @ret, $self->next;
40 }
41  
42 1 return @ret;
43 }
44  
45 1 1;
46 __END__
↑ Summary TokenStream.pm »