Merge pull request #377 from Dmitry-Me/bringDeclarationsCloserToWhereTheyreNeeded
Bring declarations closer to where they're needed.
This commit is contained in:
commit
499821de4d
|
@ -1428,13 +1428,8 @@ Function* SymbolDatabase::addGlobalFunctionDecl(Scope*& scope, const Token *tok,
|
||||||
|
|
||||||
void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const Token *argStart)
|
void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const Token *argStart)
|
||||||
{
|
{
|
||||||
int count = 0;
|
|
||||||
std::string path;
|
|
||||||
unsigned int path_length = 0;
|
|
||||||
const Token *tok1;
|
|
||||||
|
|
||||||
const bool destructor((*tok)->previous()->str() == "~");
|
const bool destructor((*tok)->previous()->str() == "~");
|
||||||
|
const Token *tok1;
|
||||||
// skip class/struct name
|
// skip class/struct name
|
||||||
if (destructor)
|
if (destructor)
|
||||||
tok1 = (*tok)->tokAt(-3);
|
tok1 = (*tok)->tokAt(-3);
|
||||||
|
@ -1445,6 +1440,10 @@ void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const To
|
||||||
if (!tok1)
|
if (!tok1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
std::string path;
|
||||||
|
unsigned int path_length = 0;
|
||||||
|
|
||||||
// back up to head of path
|
// back up to head of path
|
||||||
while (tok1 && tok1->previous() && tok1->previous()->str() == "::" &&
|
while (tok1 && tok1->previous() && tok1->previous()->str() == "::" &&
|
||||||
tok1->tokAt(-2) && tok1->tokAt(-2)->isName()) {
|
tok1->tokAt(-2) && tok1->tokAt(-2)->isName()) {
|
||||||
|
|
Loading…
Reference in New Issue