Ticket #277 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

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

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

This seems to be fixed with commit 3470.

Note: See TracTickets for help on using tickets.