Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
Rewrote the DoParse function
Loaden:
This patch only as a try, here you can change to "return".
ollydbg:
--- Quote from: MortenMacFly on April 19, 2010, 06:28:06 pm ---I realised that you already conflict with a patch of OllyDbg. It will be hard to resolve this in the end and I don't want to take such a risk later on.
--- End quote ---
@MortenMacFly
Yes, Loaden's patch about "handling conditional preprocessor" is totally different with "my patch of handling Preprocessor". We use different methods, let me give a explanation:
My patch released in the "ptest" project, see here: ParserTester for codecompletion plugin do the main work in the Tokenizer class. That is to say, when a Tokenizer return a wxString, it will never return a wxString stream like "#" "ifdef", because all the handling of conditional preprocesser directives was done in the Tokenizer::DoGetToken().
The aim I implement this was that I want to solve some problems caused by these code:
--- Code: ---void function ( int i, #ifdef AAA
int j)
#else
)
#endif
{
XXXX
};
--- End code ---
You see, when a #if is appeared in the function arguments parentheses, the parser may fail (because the current SVN code just match a closing parenthesis after it see a opening parenthesis) . But I'd say these kind of code happens in a rare situation. :D
Refer to Loaden's patch, he just do the "handling conditioanl preprocessor" in the Parserthread class. So, he didn't change Tokenizer class so much. The Most advantage of Loaden's patch is that he implement a true "expression solver". For example:
--- Code: ---//#define AAA
#ifdef AAA
#include <xxx.h>
#else
#include <yyy.h>
#endif
--- End code ---
The current SVN code (also the patch supplied by me) only parse the code like below, all the #else branches were skipped whether AAA is defined or not.
--- Code: ---//#define AAA
#include <xxx.h>
--- End code ---
But with Loaden's patch, the expression value after #if was dynamically evaluated when parsing, and only a true conditioanl preprocessor branch will be parsed.
So, As a conclusion: Loaden's Patch is much better than mine, you should pick his patch.
Navigation
[0] Message Index
[*] Previous page
Go to full version