RE: [Ctags] bug in ctags parsing of arguments?
Brought to you by:
dhiebert
From: Coen E. <Coe...@cm...> - 2001-06-11 14:46:17
|
I found out what's going wrong! Now I'm pretty sure it is a bug, and I think it's not VMS-specific. See below. > > Did you test this? I still get the same error: > > The only thing what I changed is --language-force parameter, > and it works fine. > > TEST,069 zay_$ ctags --language-force=c --totals -o tags "-L" > sources.txt > 3 files, 848 lines (21 kB) scanned in 0.0 seconds (538 kB/s) > 55 tags added to tag file > 55 tags sorted in 0.01 seconds > > My ctags version is: > > TEST,069 zay_$ ctags --version > Exuberant Ctags 5.0, Copyright (C) 1996-2001 Darren Hiebert > Addresses: <da...@hi...>, http://ctags.sourceforge.net > Optional compiled features: +vms, +internal-sort > > the very same from www.polarfox.com . I thought of something else: I downloaded the W95 version of ctags 5.0. That worked OK with "--totals". I guess it must be my VMS environment then. :-( OK, I rolled op my sleeves, downloaded http://www.polarfox.com/ctags/files/source/vms/ctags-50-src-vms.zip (as it turns out, about 2 hours before Zoltan released a 5.01 version ;-D ), compiled a debug-version and fired up the old debugger. (BTW, I got TONS of warnings from my compiler. I switched all errorchecking off to get ctags.exe built. I can mail them if anyone's interested, but a lot were of the caliber "In this statement, the enum variable "inMultilineString" is used in an arithmetic operation", i.e. not very serious) Using "monitor ParsedLeadingOptions" and careful stepping, I determined that "ParsedLeadingOptions" was initialized to FALSE, but set to "TRUE" BEFORE the command line arguments are actually parsed. I marked the spot with XXX below: $ ctags --verbose --totals Installing parsers: Asm, Asp, Awk, BETA, C, C++, Cobol, Eiffel, Fortran, Java, Lisp, Make, Pascal, Perl, PHP, Python, Ruby, Scheme, Sh, Tcl, Vim Setting option defaults Setting default header extensions: h, H, hh, hpp, hxx, h++, inc, def Installing default language mappings: Asm: .asm .s .S Asp: .asp .asa Awk: .awk .gawk .mawk BETA: .bet C: .c C++: .c++ .cc .cp .cpp .cxx .h .h++ .hh .hp .hpp .hxx Cobol: .cob .COB Eiffel: .e Fortran: .f .for .ftn .f77 .f90 .f95 Java: .java Lisp: .cl .clisp .el .l .lisp .lsp .ml Make: ([Mm]akefile) .mak Pascal: .p .pas Perl: .pl .pm .perl PHP: .php .php3 .phtml Python: .py .python Ruby: .rb Scheme: .SCM .SM .sch .scheme .scm .sm Sh: .sh .SH .bsh .bash .ksh .zsh Tcl: .tcl .tk .wish Vim: .vim Reading options from $CTAGS XXX AT THIS POINT ParsedLeadingOptions=TRUE !!! XXX Reading initial options from command line ParsedLeadingOptions is set to TRUE only in the function ParseOptions(), which is called in quite a lot of places. So, what's $CTAGS then? According to http://ctags.sourceforge.net/ctags.html#lbAN: "CTAGS If this environment variable exists, it will be expected to contain a set of default options which are read when ctags starts, after the configuration files listed in FILES, below, are read, but before any command line options are read. Options appearing on the command line will override options specified in this file. Only options will be read from this file. Note that all white space in this variable in considered a separator, making it impossible to pass an option parameter containing an embedded space. If this is a problem, use a configuration file instead." What would be the VMS equivalent of a $CTAGS environment variable? In my case, a symbol: CTAGS == "$VIM:CTAGS.EXE" Without that symbol, the following works just fine: mc DEVICE:[FULL-PATH]CTAGS.EXE --verbose --totals "-L" TMP:sources.txt Apparently my VMS-symbol CTAGS, that I only (ab)use to specify the location of ctags.exe, is read as the environment variable $CTAGS, that's supposed to contain command-line options. Rrrright. OK, I suppose that's reasonable. Also, after reading the environment variable $CTAGS, the variable ParsedLeadingOptions=TRUE, BEFORE (!!!) reading the command line options. In my opinion, this last fact is a bug, and AFAIK it's not VMS-related. Hmm... the $CTAGS thing was already implemented in ctags-3.3 (Fri Sep 17 1999). Oh well, I'm sure something has changed since 3.6pre to cause this problem. Ctags 3.6pre ignores my CTAGS-symbol. So, how do other people run ctags on VMS then? From a script? Using the logical DCL$PATH? Not at all? ;-) Coen |