Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

New code completion remarks/issues

<< < (48/54) > >>

MortenMacFly:

--- Quote from: ollydbg on December 20, 2009, 03:00:17 pm ---Currently, a workaround is to remove the "handling template related code". :D

--- End quote ---
True, but in fact I added this to trunk because in fact it helps a lot if it works. In my own projects I use templates on a "normal" level and it works very well there and thus is really helpful (for me at least).

ollydbg:
A reminder: This bug was introduced in the rev 5945.

In DoGetToken function, these code:


--- Code: ---
    else if (CurrentChar() == '<' && bTemplate)
    {
        MoveToNextChar();
        if (!SkipToOneOfChars(_T(">\r\n")), false)
            return wxEmptyString;

        MoveToNextChar();
        wxString tmp = m_Buffer.Mid(start+1,m_TokenIndex-start-2);
        tmp.Trim();
        str = _T("<");
        str += tmp;
        str += _T(">"); // m_Buffer.Mid(start, m_TokenIndex - start);
    }
--- End code ---

So, what does the SkipToOneOfChars(_T(">\r\n")), false) means?

It seems the ">" or "\r" or "\n" was the end of a template argument???

MortenMacFly:

--- Quote from: ollydbg on December 21, 2009, 05:47:31 am ---So, what does the SkipToOneOfChars(_T(">\r\n")), false) means?

--- End quote ---
So it seems VisualFC assumed that template arguments are no longer than a single line which isn't true for the STL set as you've seen... :lol:

ollydbg:
Ok, I'm planning to add a "TokenizerState" variable in the Tokenizer class.

The TokenizerState variable is normally a enum variable, and could have the following types:


--- Code: ---UnWanted
Preprocessor
Template

--- End code ---

Then, the pseudo code could be something like from the old style:


--- Code: ---void ParserThread::HandleXXXXXX()
{
    // need to force the tokenizer _not_ skip anything
    // or else default values for template params would cause us to miss everything (because of the '=' symbol)
    bool oldState = m_Tokenizer.IsSkippingUnwantedTokens();
    m_Tokenizer.SetSkipUnwantedTokens(false);
   
    DoSomething();

    m_Tokenizer.SetSkipUnwantedTokens(oldState);
}
--- End code ---

The new style:


--- Code: ---void ParserThread::HandleXXXXXX()
{

    m_Tokenizer.PushState();
   
    m_Tokenizer.SetState(YYYYY);

    DoSomething();
   
    m_Tokenizer.PopState();
}
--- End code ---

I'm not sure the "POP" and "PUSH" mechanism can work here.

ollydbg:

--- Quote from: MortenMacFly on December 21, 2009, 06:40:27 am ---
--- Quote from: ollydbg on December 21, 2009, 05:47:31 am ---So, what does the SkipToOneOfChars(_T(">\r\n")), false) means?

--- End quote ---
So it seems VisualFC assumed that template arguments are no longer than a single line which isn't true for the STL set as you've seen... :lol:

--- End quote ---

Also, what about use :

SkipToOneOfChars(_T(">")), true)

because we should let the template argument support nesting of like <   XXXX<YYYYY>>.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version