[Ctags] Use regex and --c-types=f option
Brought to you by:
dhiebert
From: Florentin I. <flo...@ya...> - 2001-11-08 07:49:21
|
Hello list, Please help me to understand what am I doing wrong in follwing cases: 1. For a file like this example-> cat -n a.cmd 1 set a=1 & goto :DONE 2 :OK 3 set /F b=%a% 4 5 set b=blah 6 7 set c=3 8 9 :DONE 10 goto :OK using ctags with following syntax, will not use the given regex although tested with sed identifies correct the variable names: ctags --langmap=sh:.cmd \ --regex-sh='/.*[Ss][Ee][Tt][ \t]+(\/[A-Za-z0-9_][ \t]+)?([A-Za-z0-9_]+)=/$2/v,var/i' The program will work correct on first option(sh), that is "goto" will be labeled but, not the variables and I can't identify what am doing wrong. 2. In vim6, in $VIM/doc, file usr_29.txt, says that using this option : ctags --c-types=f -f functions *.c that you can use command ":vsplit functions" to display a list of functions but it does not work for me( neither does --c++-types=f ) Did anybody tested succesfully these options please ? Thank you for your participation, Florentin. On Sat, 13 Oct 2001, Darren Hiebert wrote : darren)Date: Sat, 13 Oct 2001 00:01:57 -0500 (CDT) darren)From: Darren Hiebert <dar...@te...> darren)To: Florentin Ionescu <flo...@ya...> darren)Cc: Ctags Users <cta...@li...> darren)Subject: Re: [Ctags] Use regex. darren) darren)On Tue, 9 Oct 2001, Florentin Ionescu wrote: darren) darren)> I am trying to build tags for *.cmd files and what am trying to do is : darren)> darren)> 1) make ctags recognize *.cmd as *.sh file => I assume that --langmap=sh would darren)> work. darren) darren)You would need to use this: darren) darren) --langmap=sh:.cmd darren) darren)> 2) use this regex which works to recognize variable definition (rest should darren)> work fine) darren)> $varDef=~s#.*[Ss][Ee][Tt]\s+(\/\w\s+)?(\w+)=.*#$2# =>Is there a way to do this darren)> please ? darren) darren)I presume you are asking how to represent your Perl regex as a Posix darren)regex in the ctags --regex option. If so: darren) darren) '--regex-sh=/set[ \t]+(\/[A-Za-z0-9_][ \t]+)?([A-Za-z0-9_]+)=/$2/v,var/i' |