summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-05-22 13:59:57 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-05-22 13:59:57 (GMT)
commitf21a2ed4ee63b3837e20cbb6332c4b6d8b1c6cc5 (patch)
treee62f29fc590d034490871338c0a5e3a5b558789c
parent525f577318783e9cba89b473c11b770a03760fbc (diff)
downloadDoxygen-f21a2ed4ee63b3837e20cbb6332c4b6d8b1c6cc5.zip
Doxygen-f21a2ed4ee63b3837e20cbb6332c4b6d8b1c6cc5.tar.gz
Doxygen-f21a2ed4ee63b3837e20cbb6332c4b6d8b1c6cc5.tar.bz2
issue #8560: Regression: In Python/xml output, refid and qualified name of base compound not resolved under certain conditions (part 2)
-rw-r--r--src/doxygen.cpp6
-rw-r--r--src/pyscanner.l32
2 files changed, 25 insertions, 13 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index d589555..e4ec017 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -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);
@@ -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);
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);