RE: [Ctags] [PATCH] vim.c --> added variables and scoping for functions
Brought to you by:
dhiebert
From: Darren H. <da...@hi...> - 2001-04-12 06:44:29
|
On Wed, 11 Apr 2001, Jay Glanville wrote: > I have some questions concerning the regex declarations using the > addLanguageRegex. > > - Is special character tags like \w for [a-zA-Z_] accepted, or is it > preferred to use [:alnum:]? It depends upon what implementation of Posix regex you are linked against: Gnu regex or System V regex. Gnu regex, used on Linux and BSD, *does* recognize \b, \B, \<, \>, \w, \W, \`, and \'. If you need documentation on these, get the Gnu regex package from http://www.gnu.org (you may not find the detailed docs on your system by default, even though regex is available in the system libs). Any Posix implementation should recognize the [:alnum:] form. > Another question about alpha-numeric. If I > have to use [:alnum:], how to I augment this character class to include '_'? > Would it be like this: [[:alnum:]_]? As far as I understand it. > - Am I allowed to use the addLanguageRegex method twice for the same tag > type? e.g.: > addLanguageRegex( lang, "/^let [:alpha:]:([:alnum:]+)/\\1/v,variable/" ); > addLanguageRegex( lang, "/^let ([:alnum:]+)/\\1/v,variable/" ); Yes. The only read drawback is that it shows up twice in --<LANG>--types option description in the --help output. > What's the difference? The first one will match "let g:variable = ..." > while the second one will match "let variable = ...", and both will return > "variable" as the tag name. Why do I think I need this? I need something > to consume the possible existence of a scope character. The format for a > vim variable is like this: > let [s:]varname = value > where s: is optional, and states the scope of the variable. If anyone knows > of a better way to do this in a single regex, please let me know. Try this: addLanguageRegex( lang, "/^let (([:alpha:]+):)?([:alnum:]+)/\\3/v,variable/" ); > - in the HTML document that comes with the Win32 distribution > (CTAGS~VT.HTM), in the --regex-<LANG>=... section in the last sentence, you > say, "You can determine if support for regular expressions is compiled in by > examining the output of the --version option, which will include "+regex" in > the compiled feature list." However, when I use the --version tag, all I > get is name, copyright and address information. How do I confirm that my > binary was compiled with regex? Then it does not include it. If you want a precompiled Win32 binary with regex support, get it from the Ctags web site: http://ctags.sourceforge.net -- Darren Hiebert <da...@hi...> http://darren.hiebert.com |