fishman: write about patches in ctags package of Fedora

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
rename MAINTAINERS file

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
consider .in as a suffix for a template file

Like Makefile.in and foo.c.in sometimes .in is used as a suffix for a
template file.

This patch adds a new rule choosing a language parser; ".in" part at
the end of input file name is striped before comparing the extension
of file name and before matching the pattern of file name.

e.g.

	consdier input file name is "Makeflie.in".
	There is no language parser for the file name.
	With this patch Make language parser can be chosen
	from the striped file name "Makefile".

	consdier input file name is "foo.c.in".
	There is no language parser for the file name.
	With this patch C language parser can be chosen
	from the striped file name "foo.c".

The new rule is added to the end of rules in getFileLanguage.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a test to ignore .in as a template suffix when choosing language parser

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a config file and a corpus file for parsing .ctags file

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a test case for .ctags parser

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
refactor: use callbacks to evaluate flags of --regex-<LANG> option

flags of --regex-<LANG> option was evaluated with switch/case control
structure. To make flags slot more extensible, use callback functions
for the evaluation instead of switch/case.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a test case for i flag of --regex-<LANG> option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
regex: introduce a flag to cut off the rest of matching operations

The regex language parser tries matching all expressions with ALL lines of
given files regardless one of expression is actually matched or not.

This patch introduces a flag `!'. If an expression with ! is matched
with a line, the regex language parser doesn't try the rest of
expressions with the line.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
mib: use ! flag

To avoid being tagged "DEFINITIONS ::= BEGIN"
line twice, use ! flag.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
introduce long flag of --regex-<LANG> option

To make long more self descriptive long name flag
is introduced. It is like long option for command
line parser.

long flag names are defined for existing short flags:

 <short> |  <long>
---------+----------
    b    |  basic
    e    |  extend
    i    |  icase
    !    |  cut

TODO: ctags.1 must be updated.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a test case for long flag of --regex-<LANG> option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
supprot .extension and (pattern) notation for --<LANG>-corpus option

NOTE: This is a temporary commit.
      objc-tg-corpus.d unit test fails with this commit.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
unify simplify lang parser choosing mechanism

When choosing a lang parser, a file name is tested twice: once with
file extension and once with file name pattern.  This patch integrates
choosing lang parser with file extension chooser into that with file
name pattern.

As the result the code is simplified; and conflictions with the two
tests can be arbitrated with single getTwoGramLanguage call.

Now objc-tg-corpus.d test case runs succssfully.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
improve help message of --list-corpora option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
introduce alias mechanism for language name

This patch introduces --<LANG>-alias= and --list-aliases=
options.

An alias is alternative name for a lang parser.  When choosing a lang
parser refers the contents of input file to extract an interpreter
name, emacs major mode information or vim surtax name. The alias is
matched with the extracted string to choose a parser.

The extracted name was compared with language own file extension
tables and language parser names. The language parser names are
suitable for this purpose. However, file extensions are not suitable.

e.g. Consider "#!/usr/bin/python3" is found in an input file named
input "input.nolang".

You may want ctags to choose python language parser from the "python3"
automatically. Before introducing this alias mechanism, you have to
add "python3" to extension list like:

    static const char *const extensions[] = { "py", "pyx", "pxd", "pxi" ,"scons",
                                             "python3", NULL };

However, python3 is not an extensions. Even if you add python3 to
extension list, there is no serious bad effect. However, for making
ctags applicable to more complex situation, two concepts "extension"
and "the name of interpreter" are better to be separated.

An alias for a LANG can be defined with aliases field of
parserDefinition struct or --<LANG>-alias= option. The alias is
treated as a glob pattern when matching a string extracted from input
file.

e.g.

	--python-alias="python[23]"

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
define aliases for python

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
add a test case for --<LANG>-alias option

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
define aliases for c

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
define aliases for jscript

Signed-off-by: Masatake YAMATO <yamato@redhat.com>