Tagging a class definition with a macro
Computing 2018. 8. 27. 12:23Let's say we have following macro that defines a class definition:
- #define DEFINE_A_CLASS(aClass) \
- class aClass: public Base<aClass##Req, aClass##Res>
- DEFINE_A_CLASS(Foo)
- {
- public:
- Foo() : mBar(0)
- {
- }
- public:
- int mBar;
- };
To make the exuberent-ctags to tag this file correctly, you can use --regex-<LANG> option:
- ctags --fields=+iaS --extras=+q --languages=C++ --regex-c++='/DEFINE_ACTION_CLASS\(([A-Za-z][A-Za-z0-9_]*)\)/\1/c,class,class definition/'