save start parentheses of global functions

This commit is contained in:
Robert Reif 2011-03-12 20:35:52 -05:00
parent f3728c0b76
commit 51662eeedd
1 changed files with 16 additions and 0 deletions

View File

@ -349,6 +349,14 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
function.arg = function.argDef; function.arg = function.argDef;
function.type = Function::eFunction; function.type = Function::eFunction;
// find start of function '{'
const Token *start = tok;
while (start && start->str() != "{")
start = start->next();
// save start of function
function.start = start;
addNewFunction(&scope, &tok); addNewFunction(&scope, &tok);
if (scope) if (scope)
@ -395,6 +403,14 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
function.type = Function::eFunction; function.type = Function::eFunction;
function.retFuncPtr = true; function.retFuncPtr = true;
// find start of function '{'
const Token *start = tok;
while (start && start->str() != "{")
start = start->next();
// save start of function
function.start = start;
addNewFunction(&scope, &tok1); addNewFunction(&scope, &tok1);
if (scope) if (scope)