Add explicit mapping of ctags tag types to Geany tag types
commit5d9376ea801a6e6c3ec22748741362a3a2eff7ac
authorJiří Techet <techet@gmail.com>
Tue, 22 Mar 2016 16:03:16 +0000 (22 17:03 +0100)
committerJiří Techet <techet@gmail.com>
Tue, 22 Mar 2016 16:03:16 +0000 (22 17:03 +0100)
treea77a90d622a31c10ff9a5739fd065f44a78d9af9
parentaea7d7845917843dd6b02e5a8dc9031cabc87a86
Add explicit mapping of ctags tag types to Geany tag types

At the moment tag types are changed in ctags to match the types Geany
uses internally. This introduces differences between the parsers used
in ctags and the ones used in Geany.

Instead, perform the "ctags tag type"->"geany tag type" mapping explicitly
in TM and leave the tag types in individual parsers identical to ctags.
For parsers which are present in ctags (and which don't seem to be
completely different from the parsers used in Geany) revert the tag type
change in the parsers so the parser tag definitions match universal-ctags.
This patch doesn't do anything with the tag types of parsers not present
in universal-ctags and leaves them as they are.

Parsers which previously had a mapping to an non-existent Geany type have
now the mapping explicitly set to tm_tag_undef_t. Since the mapping is now
made through the one-letter type, some of the parsers had to be adjusted
because they used single letter for multiple tag types (probably by
mistake).

Because the whole mapping process might be a bit fragile and error-prone
to changes in ctags parsers, the patch also performs some consistency
checks:

* whether the parser number in ctags/TM matches
* whether for the given language the tag type number is identical in TM
  mapping and ctags definition
* whether all tag types defined in ctags parser are mapped in TM and in
  reverse, whether all mapped tags in TM are defined in ctags parser
* whether there aren't duplicate tag types

Unfortunately the checks are possible only for parsers not using regex
because regex definitions are not exposed by ctags (TODO).

A bonus side effect of the changes is we can now use real tag types defined
for each languages in ctags when parsing ctags tag files instead of
using the hard-coded static values which mostly work just for C/C++.
34 files changed:
tagmanager/ctags/actionscript.c
tagmanager/ctags/asm.c
tagmanager/ctags/basic.c
tagmanager/ctags/c.c
tagmanager/ctags/cobol.c
tagmanager/ctags/css.c
tagmanager/ctags/erlang.c
tagmanager/ctags/fortran.c
tagmanager/ctags/go.c
tagmanager/ctags/html.c
tagmanager/ctags/js.c
tagmanager/ctags/json.c
tagmanager/ctags/make.c
tagmanager/ctags/parse.c
tagmanager/ctags/parse.h
tagmanager/ctags/pascal.c
tagmanager/ctags/perl.c
tagmanager/ctags/php.c
tagmanager/ctags/python.c
tagmanager/ctags/r.c
tagmanager/ctags/ruby.c
tagmanager/ctags/rust.c
tagmanager/ctags/sql.c
tagmanager/ctags/tcl.c
tagmanager/ctags/verilog.c
tagmanager/ctags/vhdl.c
tagmanager/src/Makefile.am
tagmanager/src/tm_ctags_wrappers.c
tagmanager/src/tm_ctags_wrappers.h
tagmanager/src/tm_parser.c [new file with mode: 0644]
tagmanager/src/tm_parser.h
tagmanager/src/tm_source_file.c
tagmanager/src/tm_tag.c
tagmanager/src/tm_tag.h