Skip to content

Commit

Permalink
issue #8560: Regression: In Python/xml output, refid and qualified na…
Browse files Browse the repository at this point in the history
…me of base compound not resolved under certain conditions (part 2)
  • Loading branch information
doxygen committed May 22, 2021
1 parent 525f577 commit f21a2ed
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
6 changes: 5 additions & 1 deletion src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,6 @@ static void buildNamespaceList(const Entry *root)
nd->setName(fullName); // change name to match docs
nd->addSectionsToDefinition(root->anchors);
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->setArtificial(FALSE); // found namespace explicitly, so cannot be artificial
if (nd->getLanguage()==SrcLangExt_Unknown)
{
nd->setLanguage(root->lang);
Expand All @@ -1687,6 +1686,11 @@ static void buildNamespaceList(const Entry *root)

// file definition containing the namespace nd
FileDef *fd=root->fileDef();
if (nd->isArtificial())
{
nd->setArtificial(FALSE); // found namespace explicitly, so cannot be artificial
nd->setDefFile(root->fileName,root->startLine,root->startColumn);
}
// insert the namespace in the file definition
if (fd) fd->insertNamespace(nd);
addNamespaceToGroups(root,nd);
Expand Down
32 changes: 20 additions & 12 deletions src/pyscanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f21a2ed

Please sign in to comment.