[Lxr-dev] [ lxr-Feature Requests-3219549 ] Cope with language-specific syntax for include
Brought to you by:
ajlittoz
From: SourceForge.net <no...@so...> - 2011-03-17 11:10:44
|
Feature Requests item #3219549, was opened at 2011-03-17 12:10 Message generated for change (Tracker Item Submitted) made by ajlittoz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390120&aid=3219549&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: Language support Group: None Status: Open Priority: 3 Private: No Submitted By: Andre-Littoz (ajlittoz) Assigned to: Nobody/Anonymous (nobody) Summary: Cope with language-specific syntax for include Initial Comment: Presently LXR is able to detect 'include' constructs but it is process in the C spirit, i.e. what follows the keyword is supposed to be the filename with standard OS path. In Perl, the include object after 'use' may contain :: separators instead of / and does not include the file extension like .pm. It would be nice if processinclude may take into account the syntax of the language to manipulate the file argument before handing it over to incref. This could be done through a new parameter in generic.cong language description while retaining the present processing as a default. For Perl, we could have: , 'include' => { 'directive' => '([\\w]+)(\s+)()([\\w:]+)(\\b)' , 'global' => [ '::', '/' ] , 'last' => [ '$', '.pm' ] } 'directive' is used to split the fragment coming from parsing into the keyword $1, some space $2, the target file $3 and the rest of the fragment $4. The target file is first submitted to 'first' one-shot substitution, then to 'global' repeated substitution (with g modifier) and finally to 'last' one-shot substitution. The above example says: replace all occurrences of :: by /. In the end add extension .pm to resultant path. At this step we have a "standard" filename which can be handed to the common incref processing. If it hits a known file, it can be highlighted and can be clicked. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=390120&aid=3219549&group_id=27350 |