« blib/lib/PMLTQ/Relation/DescendantIterator.pm
↑ Summary
blib/lib/PMLTQ/Relation/PDT/AEParentIterator.pm »
| 1 | package PMLTQ::Relation::CurrentTreeIterator; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 12 | our $AUTHORITY = 'cpan:MATY'; | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | 12 | $PMLTQ::Relation::CurrentTreeIterator::VERSION = '1.2.2'; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: Iterates over nodes of current tree | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 12 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 12 | ▶ | use base qw(PMLTQ::Relation::Iterator); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 12 | ▶ | use constant CONDITIONS=>0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 12 | ▶ | use constant NODE=>1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | sub start { | ||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | $TredMacro::this=$TredMacro::root; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | $self->[NODE]=$TredMacro::this; | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | return ($TredMacro::this && $self->[CONDITIONS]->($TredMacro::this,TredMacro::CurrentFile())) ? $TredMacro::this : ($TredMacro::this && $self->next); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$TredMacro::this and $self->[0]->($TredMacro::this, TredMacro::CurrentFile())
$TredMacro::this and $self->next
MC/DC0%0/2
$TredMacro::this and $self->[0]->($TredMacro::this, TredMacro::CurrentFile())
$TredMacro::this
$self->[0]->($TredMacro::this, TredMacro::CurrentFile())
MC/DC0%0/2
$TredMacro::this and $self->next
$TredMacro::this
$self->next
Truth table0%0/3
A and B
A= $TredMacro::thisB= $self->[0]->($TredMacro::this, TredMacro::CurrentFile())
Truth table0%0/3
A and B
A= $TredMacro::thisB= $self->next
| |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | sub next { | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $conditions=$self->[CONDITIONS]; | |||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | my $n=$self->[NODE]; | |||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | my $fsfile=TredMacro::CurrentFile(); | |||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | while ($n) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | $n = $n->following; | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | last if $conditions->($n,$fsfile); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | return $self->[NODE]=$n; | |||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | sub file { | ||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | return TredMacro::CurrentFile(); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | sub node { | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | return $_[0]->[NODE]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
node: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | sub reset { | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reset: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | $self->[NODE]=undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 12 | 1; # End of PMLTQ::Relation::CurrentTreeIterator | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||