Thread: [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 |
From: SourceForge.net <no...@so...> - 2011-03-11 16:35:44
|
Bugs item #3204208, was opened at 2011-03-09 15:00 Message generated for change (Settings changed) 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: Works For Me Priority: 5 Private: No Submitted By: Andre-Littoz (ajlittoz) >Assigned to: Andre-Littoz (ajlittoz) 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 |
From: SourceForge.net <no...@so...> - 2011-03-12 13:06:35
|
Bugs item #3204208, was opened at 2011-03-09 15:00 Message generated for change (Comment added) 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: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Andre-Littoz (ajlittoz) Assigned to: Andre-Littoz (ajlittoz) 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 ------------------------------ ---------------------------------------------------------------------- >Comment By: Andre-Littoz (ajlittoz) Date: 2011-03-12 14:06 Message: Incorporated fix ---------------------------------------------------------------------- Comment By: Andre-Littoz (ajlittoz) Date: 2011-03-12 14:06 Message: This has now been fixed in CVS. If you can install the new version and check that it solves your problem, then it would be very useful. Thanks for reporting this defect and helping to make LXR better. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390117&aid=3204208&group_id=27350 |