Menu

#644 syntax highlighting fails

v0.5.x
closed-fixed
nobody
Editor (234)
5
2016-05-12
2012-04-02
Anonymous
No

the syntaxhihighlighting breaks for the following code

sub extract_objects_from_makefile {

# return an array of all used .o files from makefile

my ($file) = @_;
my @objects = 0;

open ( MAKEFILE, "<$file" ) || die_call( "\nvia open(r) of $file\n$!\n" );
while (<MAKEFILE>) { last if ( m/^\s*OBJ\s*\=/ ); }
s/\#.+$//;
s/^\s*OBJ\=\s*//;
s/\\\s*$//;
s/\s+$//;
@objects = split /\s+/, $_;

while (<MAKEFILE>) {
last if ( m/^\s*$/ );
s/\#.+$//;
s/\\\s*$//;
s/\s+$//;
s/^\s+//;
push @objects, split /\s+/, $_;
}
close MAKEFILE;

return @objects;
}

Discussion

  • dyakov

    dyakov - 2014-06-26

    Fails on split /\s+/, $line;, right after last / and until nearest +.

    Is fixed by adding m or using {} in the code. I'd say this is very serious problem: it can break both syntax highlight and code parsing. e.g. in my code the area of "confusion" (from / to nearest +) includes a subroutine declaration, so this subroutine is completely invisible to parser.

     

    Last edit: dyakov 2014-06-26
    • Jan Ploski

      Jan Ploski - 2014-06-26

      Also fixed by using the syntax split(/\s+/, $line); which seems like a good idea anyway (make function parameter lists appear as such).

       
  • dyakov

    dyakov - 2014-06-27

    ... which, of course, does not mean this EPIC bug does not need to be fixed. This bug severely depletes EPIC's usefulness for browsing through the code.

     
  • Oliver Trosien

    Oliver Trosien - 2016-05-12

    Just tested with 0.7.0. The syntax highlighting looks good. Closing as fixed.

     
  • Oliver Trosien

    Oliver Trosien - 2016-05-12
    • status: open --> closed-fixed
     

Log in to post a comment.