[Lxr-dev] [ lxr-Bugs-3204208 ] Script language not always recognised
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2011-03-09 14:00:28
|
Bugs item #3204208, was opened at 2011-03-09 15:00 Message generated for change (Tracker Item Submitted) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204208&group_id=27350 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lang support Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andre-Littoz (ajlittoz) Assigned to: Nobody/Anonymous (nobody) Summary: Script language not always recognised Initial Comment: LXR v0.9.8 In Lang.pm When trying to determine script language, test is for the beginning of the last part of a path, i.e. /interp. Matches if key of 'interpreters' is a prefix of the script interpreter name. Unhappily, prevents LXR-scripts from being recognised as they do not include a path. Test changed to match 'interpreters' name at end of string (without /) Potential problem: it is no longer a prefix test; are there cases where it matters? !-53,53 110227 (replace line 53 of new with:) ! if ($shebang =~ /$patt$/) { ---------------------- end of path -------------------------------- There is a related issue: Some files which are not scripts contain an emacs specification telling which language is used (e.g. the *.conf files in LXR). In that case, parse the spec to extract the language name and act just as if it was a script. !-46,46 110308 (replace line 46 with:) ! my $line = $fh->getline; ! ($line =~ /^\#!\s*(\S+)/s) ! || ($line =~ /^.*-[*]-.*?[ \t;]mode:[ \t]*(\w+).*-[*]-/); --------------------------- end of patch ------------------------------ ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204208&group_id=27350 |