summaryrefslogtreecommitdiffstats
path: root/src/pyscanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/pyscanner.l')
-rw-r--r--src/pyscanner.l34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l
index 4f331c9..a34dc18 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -180,7 +180,7 @@ LONGSTRINGCHAR [^\\"']
ESCAPESEQ ("\\")(.)
LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ})
SMALLQUOTE ("\"\""|"\""|"'"|"''")
-LONGSTRINGBLOCK ({LONGSTRINGITEM}+|{SMALLQUOTE})
+LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE})
SHORTSTRING ("'"{SHORTSTRINGITEM}*"'"|'"'{SHORTSTRINGITEM}*'"')
SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ})
@@ -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);