Changeset 8555


Ignore:
Timestamp:
10/03/09 03:57:22 (2 years ago)
Author:
Sewi
Message:

Fixed most of the test errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Document/Perl/Beginner.pm

    r8545 r8555  
    6767    my $editor   = $document->{editor}; 
    6868 
    69     my $line = $editor->LineFromPosition( length($1) ); 
     69    my $prematch = $1 || ''; 
     70    my $error_start_position = length($prematch); 
     71 
     72    my $line = $editor->LineFromPosition( $error_start_position ); 
    7073    ++$line; # Editor starts counting at 0 
    7174 
     
    7881sub check { 
    7982    my ( $self, $text ) = @_; 
    80     $self->{error} = undef; 
     83 
     84    # TODO: Change this back to undef: 
     85    $self->{error} = ''; 
    8186 
    8287=item * 
     
    210215 
    211216    if ( ( $text =~ /^(.*?)open[\s\t\r\n]*\(?\$?\w+[\s\t\r\n]*(\,.+?)?[\s\t\r\n]*\,[\s\t\r\n]*?([\"\'])(.*?)\|(.*?)\2/ ) 
    212         and ( length($3) > 0 ) 
    213         and ( length($4) > 0 ) ) 
     217        and ( length($4) > 0 ) 
     218        and ( length($5) > 0 ) ) 
    214219    { 
     220        print STDERR join(',',map { "[[$_]]"; }($1,$2,$3,$4,$5,$6))."\n"; 
    215221        $self->_report("Using a | char in open without a | at the beginning or end is usually a typo."); 
    216222        return; 
     
    236242=cut 
    237243 
    238     if ( $text =~ m{^(.*?)\=\~  [\s\t\r\n]*  \/ \^?  [\+\*\?\{] }xs ) { 
     244    if ( $text =~ m/^(.*?)\=\~  [\s\t\r\n]*  \/ \^?  [\+\*\?\{] /xs ) { 
    239245        $self->_report( 
    240246            "A regular expression starting with a quantifier ( + * ? { ) doesn't make sense, you may want to escape it with a \\." 
Note: See TracChangeset for help on using the changeset viewer.