Opened 6 years ago

Closed 5 years ago

#277 closed defect (fixed)

Lexical variable replace doesn't work for "foreach my $foo (...) {}"

Reported by: tsee Owned by:
Priority: minor Milestone:
Component: editor Version: 0.29
Keywords: Cc:

Description

Summary says it all:
Lexical variable replace doesn't work for "foreach my $foo (...) {}"

Essentially, the problem is that the my $foo isn't find as the variable's declaration, so this needs to be fixed in Padre::PPI's code that searches for the declaration.

Change History (2)

comment:1 Changed 5 years ago by tsee

Furthemore, the current implementation may find additional declarations like this:

my $i;
if (1) {

if (1) {

$i++; # cursor here! => Hit "find lexical variable declaration"

}
my $i; # <== this is found as the declaration!

}

comment:2 Changed 5 years ago by tsee

  • Resolution set to fixed
  • Status changed from new to closed

This seems to be fixed with commit 3470.

Note: See TracTickets for help on using tickets.