Changeset 5408


Ignore:
Timestamp:
06/20/09 05:33:20 (3 years ago)
Author:
azawawi
Message:

[Perl 6] initial quick fix implementation for "Variable is not predeclared" warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre-Plugin-Perl6/lib/Padre/Plugin/Perl6/Perl6Document.pm

    r5407 r5408  
    200200        my $issue_line_no = $issue->{line} - 1; 
    201201        if($issue_line_no == $current_line_no) { 
    202             if($issue->{msg} =~ /^Undeclared routine:\s+(.+?)\s+used/i) { 
     202            my $issue_msg = $issue->{msg}; 
     203            my $comment_error_action = 0; 
     204            if($issue_msg =~ /Variable\s+(.+?)\s+is not predeclared at/i) { 
     205                 
     206                my $var_name = $1; 
     207                Wx::Event::EVT_MENU( 
     208                    $main,  
     209                    $menu->Append( -1, sprintf( Wx::gettext("Insert declaration for '%s'"), $var_name) ), 
     210                    sub {  
     211                        #XXX-implement insert variable declaration 
     212                    }, 
     213                ); 
     214                $comment_error_action = 1; 
     215             
     216            } elsif($issue_msg =~ /^Undeclared routine:\s+(.+?)\s+used/i) { 
     217                 
    203218                my $routine_name = $1; 
    204219                Wx::Event::EVT_MENU( 
    205220                    $main,  
    206                     $menu->Append( -1, sprintf( Wx::gettext("Insert sub '%s'\t"), $routine_name) ), 
     221                    $menu->Append( -1, sprintf( Wx::gettext("Insert sub '%s'"), $routine_name) ), 
    207222                    sub {  
    208223                        #XXX-implement insert routine 
    209224                    }, 
    210225                ); 
     226                $comment_error_action = 1; 
     227             
     228            } 
     229             
     230            if($comment_error_action) { 
    211231                Wx::Event::EVT_MENU( 
    212232                    $main,  
     
    217237                ); 
    218238            } 
     239             
    219240        } 
    220241    } 
Note: See TracChangeset for help on using the changeset viewer.