Here is my test code:
void f()
{
if(TxmlElement* problem = handle.FirstChildElement("test"))
{
/// ---> will not code complete on 'problem'
problem;
}
}
void f2()
{
if(TxmlElement* problem1 = handle.FirstChildElement("test"))
{
/// ---> will not code complete on 'problem'
problem1;
}
}
And I see the patch works very nice. I right click on "problem", and select find declaration, it goes to the correct position.
When I click on the "problem1", I see the temp Token "problem" is cleared, and new temp Token "problem1" is created.
Nice work, koonschi.
Well, it is the first time that I contribute to Code::Blocks, too Smiley I hope I did not break any rules by using it.
It seemed like the easiest thing to do though, as the expressions in parentheses are parsed as one single token. I did not want to mess around with that, as it's used for function parameters, too.
I hope this is the beginning of your contribution to C::B, welcome!!!!
It dose not break any rules. I have no objection to use another instance of Tokenizer class in Parserthread class.
Besize that, we have a function in Parserthread
bool ParserThread::GetBaseArgs(const wxString & args, wxString& baseArgs)
which translate a complex full function arguments to a simple arguments like:
void f(int a=1, float *p=0x777);
here, (int a=1, float *p=0x777) will be translated to (int a, float *p), I think here we also need a smallTokenizer.
, because sometimes, there are nested "()" in the function arguments, currently implementation of GetBaseArgs() does not work correctly about those nest parentheses.