Re: [Ctags-devel] Passing language-specific options from command line.
Brought to you by:
dhiebert
From: Darren H. <dhi...@us...> - 2006-10-30 03:27:01
|
On Saturday 28 October 2006 13:33, Dmitri Tikhonov wrote: > finally, I am about to start working on perl.c -- something I have been > wanting to do for a while. Besides fixing various bugs, I would like > to introduce some advanced features to Perl parser, such as creating > tags for custom exception objects. Because exceptions in Perl may have > different names, I'd like to add the ability to pass language-specific > options from command line, for example: > > ctags --language-specific:perl=exception=My::Exception::Class > > The above reads: pass language-specific argument to Perl parser -- > "treat My::Exception::Class as exceptions." > > A sample backward-compatible patch can be seen here: > > http://dmitri.perlmonk.org/ctags/ > > I would like to know what everyone (and especially Darren) think about > this. I believe other parsers can benefit from having specific > options. Generally, I take a very conservative approach and am fairly reticent to introduce new options for the following reasons: 1. Documentation burden. Every options require documentation for anyone to make use of it. The more options offered the longer the documentation and the less likely someone will read it. I can't tell you how often people ask me questions on things answered by the man page. 2. Consistency across languages. Now that ctags supports 34 languages, you can imagine how complex using and documenting ctags becomes if each language supports some different way of doing something. I have striven very hard to unify the way ctags handles each language. 3. Difficulty in taking them back once introduced. One an option is introduced, it is hard to take it back, as others may have written scripts or ctags init files and a disappearing option breaks these. So, how to respond to the present request for a way of introducing support for language-specific options? My first and strongest response is to find some way to avoid it if at all possible, either by making the parser smart enough to do the "right thing", by introducing a new tag kind that can be turned on or off, or some other clever idea. Now, I can't say right off how to do that in this specific case, since I don't know Perl well enough to understand how it deals with exceptions. Perhaps there are those out there who do and maybe you folks can put your heads together and come to an agreement as to whether it is necessary to be able to specify particular exceptions for special handling, or brainstorm other ideas of accomplishing the desired behavior. Regards, Darren -- Darren Hiebert http://darrenhiebert.com http://ctags.sourceforge.net |