diff options
Diffstat (limited to 'src/pyscanner.l')
-rw-r--r-- | src/pyscanner.l | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l index 4f331c9..bf2a914 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1838,18 +1838,26 @@ static void parseMain(yyscan_t yyscanner, const QCString &fileName,const char *f yyextra->moduleScope+=baseName; } - yyextra->current = std::make_shared<Entry>(); - initEntry(yyscanner); - yyextra->current->name = yyextra->moduleScope; - yyextra->current->section = Entry::NAMESPACE_SEC; - yyextra->current->type = "namespace"; - yyextra->current->fileName = yyextra->yyFileName; - yyextra->current->startLine = yyextra->yyLineNr; - yyextra->current->bodyLine = yyextra->yyLineNr; - - yyextra->current_root = yyextra->current; - - rt->moveToSubEntryAndRefresh(yyextra->current); + // add namespaces for each scope + QCString scope = yyextra->moduleScope; + int startPos = 0; + int pos; + do + { + pos = scope.find("::",startPos); + startPos=pos+2; + if (pos==-1) pos=(int)scope.length(); + yyextra->current = std::make_shared<Entry>(); + initEntry(yyscanner); + yyextra->current->name = scope.left(pos); + yyextra->current->section = Entry::NAMESPACE_SEC; + yyextra->current->type = "namespace"; + yyextra->current->fileName = yyextra->yyFileName; + yyextra->current->startLine = yyextra->yyLineNr; + yyextra->current->bodyLine = yyextra->yyLineNr; + yyextra->current_root = yyextra->current; + rt->moveToSubEntryAndRefresh(yyextra->current); + } while (pos<(int)scope.length()); initParser(yyscanner); |