Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
using namespace
Alpha:
While going through this patch, I noticed that using namespace is only (or at least, seems to be only) parsed in the global scope. Is this a known problem? Is it supposed to work (currently)?
ollydbg:
--- Quote from: Alpha on April 10, 2013, 08:15:53 pm ---While going through this patch, I noticed that using namespace is only (or at least, seems to be only) parsed in the global scope. Is this a known problem?
--- End quote ---
Note that parser in batch mode (parsing local files) has no need to handle "using namespace" statements in function bodies.
There is another function:bool ParserThread::ParseBufferForUsingNamespace(const wxString& buffer, wxArrayString& result) which handle local using namespace statements.
Another thing: I think TokenIdxSet is better than "std::vector<int>" in the patch.
Alpha:
--- Quote from: ollydbg on April 11, 2013, 02:15:32 am ---There is another function:bool ParserThread::ParseBufferForUsingNamespace(const wxString& buffer, wxArrayString& result) which handle local using namespace statements.
--- End quote ---
Yes, however on line 414, function bodies are skipped. (I think I have a solution though.)
--- Code: --- else if (token==ParserConsts::opbrace)
{
SkipBlock();
}
--- End code ---
--- Quote from: ollydbg on April 11, 2013, 02:15:32 am ---Another thing: I think TokenIdxSet is better than "std::vector<int>" in the patch.
--- End quote ---
Yes (I have a few other local modifications also).
MortenMacFly:
--- Quote from: ollydbg on April 11, 2013, 02:15:32 am ---Another thing: I think TokenIdxSet is better than "std::vector<int>" in the patch.
--- End quote ---
Yes. This patch needs a clean-up. I did it in my local copy as well...
Alpha:
Attached patch includes tidied up version of the previous patch (by p2rkw), and parsing of function bodies for using namespace directives.
Feedback appreciated.
Navigation
[0] Message Index
[#] Next page
Go to full version