Here is what I understood :
The preprocessor definitions must be entered as keyword 5 for c++, and the lexer.cpp.track.preprocessor, and lexer.cpp.update.preprocessor should be set to 1 as describe here.
I gave a look to the lexcpp file, but it's not so easy to understand. But It gaves me some ideas to improve the preprocessor handling in codelite :
1 - The first step I see is to allow the user to add preprocessor definitions and CodeLite will add it to the keyword5.
2 - Much more sophisticated : The CodeLite preprocessor may use the lexcpp code to improve the preprocessing in order to find itself all other preprocessing definitions in the headers found by include_finder.
3 - ... and it shall improve the way how CodeLite register the good definition of token (if there are multiple definitions according to preprocessor definitions) :
Code: Select all
#define FOO
...
#ifdef FOO
class Foo {
...
};
#else
class Foo {
...
};
#endif
I you have some idea how to implement this, I would be happy to help you on this subject as it will greatly improve this Editor. Let me know