Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 13471
Status: resolved
Worked: 20 min
Priority: 0/
Queue: PPI

People
Owner: adamk [...] cpan.org
Requestors: perl [...] broquaint.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.993
Fixed in: (no value)



Subject: A given document seemingly has circular siblings
This simple code loops forever: use PPI::Document; my $d = PPI::Document->new(\q[use foo; sub this { foo->load } this(); 1;]); my $sub = $d->find(q[Statement::Sub])->[0]; print "sib is: $sub\n" while $sub and $sub = $sub->sprevious_sibling; So we get output like this: sub: sub this { foo->load } sib is: use foo; sib is: 1; sib is: this(); sib is: sub this { foo->load } sib is: use foo; sib is: 1; sib is: this(); sib is: sub this { foo->load } sib is: use foo; sib is: 1; sib is: this(); sib is: sub this { foo->load } sib is: use foo; sib is: 1; sib is: this(); sib is: sub this { foo->load } Which isn't healthy. So it looks like a circular link is created in amongst the siblings. Dan aka broquaint
Subject: A given document seemingly has circular siblings (only with sprevious_sibling)
[BROQ - Wed Jun 29 13:02:23 2005]: Show quoted text
> This simple code loops forever: > > use PPI::Document; > > my $d = PPI::Document->new(\q[use foo; sub this { foo->load } this(); > 1;]); > my $sub = $d->find(q[Statement::Sub])->[0]; > print "sib is: $sub\n" > while $sub and $sub = $sub->sprevious_sibling;
The problem looks to be the sprevious_sibling() method as when the above code uses previous_sibling() it works fine. Dan aka broquaint
Subject: A given document seemingly has circular siblings (previous_sibling() is not a silver bullet)
[BROQ - Wed Jun 29 13:07:05 2005]: Show quoted text
> [BROQ - Wed Jun 29 13:02:23 2005]: >
> > This simple code loops forever: > > > > use PPI::Document; > > > > my $d = PPI::Document->new(\q[use foo; sub this { foo->load }
> this();
> > 1;]); > > my $sub = $d->find(q[Statement::Sub])->[0]; > > print "sib is: $sub\n" > > while $sub and $sub = $sub->sprevious_sibling;
> > The problem looks to be the sprevious_sibling() method as when the > above > code uses previous_sibling() it works fine.
But I'm still finding an infinite loop even when using previous_sibling() against different code. Will investigate further ... Dan aka broquaint