Use cxx parser from uctags by techee · Pull Request #3032 · geany/geany (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This is to avoid clash with cpreprocessor.c/h used by the new cxx parser. Merging lcpp.c/h with cpreprocessor.c/h would be difficult (at least for now) because of the differences in c.c so keep them separate for now.
As a result, when we copy the new cxx parser, we don't have clashes of these symbols from the two different parsers.
This patch only makes the parser compile, it doesn't enable it yet.
There are several things needed for this:
The new preprocessor has to be defined as a separate parser.
Tags from the new c/c++ parsers and the preprocessor parser have to be mapped to Geany types. We still need to keep the old mappings because some parsers like Ferite or GLSL still use the old C parser.
Anonymous tags have a different name so we have to reflect this in tm_tag_is_anon().
The changes are mostly these:
- Spaces in function argument list
(int var1, int var2, ...) - before (int var1,int var2,...) - now
- Anonymous tags
anon_struct_1 anon_union_2 anon_typedef_3
vs
__anon1 __anon2 __anon3
- Improved parsing of the new parser
The syntax is slightly different from the previous syntax and is described here:
https://docs.ctags.io/en/latest/parser-cxx.html
Basic usage should be the same, uctags just doesn't support Geany's wildcard ignores like G_GNUC_*. On the other hand the new parser is much more resilient to macros so there shouldn't be so much need for manual ignores.
The original code is still kept for parsers from c.c that still use the old preprocessor.
Conflicts:
ctags/Makefile.am
ntrel mentioned this pull request