| 1 | package Pegex::Receiver; | ||||||||||||||||||||||||||||
| 2 | 18 | ▶ | use Pegex::Base; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 18 | has parser => (); # The parser object. | |||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 0 | ▶ | sub rule { $_[0]->{parser}{rule} } | ||||||||||||||||||||||||||
|
Subroutine
rule: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | # Flatten a structure of nested arrays into a single array in place. | ||||||||||||||||||||||||||||
| 9 | 1 | ▶ | sub flatten { | ||||||||||||||||||||||||||
|
Subroutine
flatten: called CC=5 SCAR=16.4
Pod
documented
| |||||||||||||||||||||||||||||
| 10 | 1 | my ($self, $array, $times) = @_; | |||||||||||||||||||||||||||
| 11 | 1 | ▶ | $times = -1 | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | unless defined $times; | ||||||||||||||||||||||||||||
| 13 | 1 | ▶ | while ($times-- and grep {ref($_) eq 'ARRAY'} @$array) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$times-- and grep {ref $_ eq "ARRAY";} @$array
MC/DC50%1/2
$times-- and grep {ref $_ eq "ARRAY";} @$array
$times--
grep {ref $_ eq "ARRAY";} @$array
Truth table66%2/3
A and B
A= $times--B= grep {ref $_ eq "ARRAY";} @$array
| |||||||||||||||||||||||||||||
| 14 | @$array = map { | ||||||||||||||||||||||||||||
| 15 | 2 | ▶ | (ref($_) eq 'ARRAY') ? @$_ : $_ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | } @$array; | ||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | 1 | return $array; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 18 | 1; | |||||||||||||||||||||||||||