|
Scott Talbert |
2f055b |
From 9d9d08582ccea7ef90000acebfd09f8c8acc577a Mon Sep 17 00:00:00 2001
|
|
Scott Talbert |
2f055b |
From: Dimitri van Heesch <doxygen@gmail.com>
|
|
Scott Talbert |
2f055b |
Date: Fri, 28 Aug 2020 20:22:46 +0200
|
|
Scott Talbert |
2f055b |
Subject: [PATCH] issue #7979: C++ enums being defined in multiple files after
|
|
Scott Talbert |
2f055b |
b265433 (multi-thread input processing)
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
---
|
|
Scott Talbert |
2f055b |
src/scanner.l | 16 ++++++++--------
|
|
Scott Talbert |
2f055b |
1 file changed, 8 insertions(+), 8 deletions(-)
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
diff --git a/src/scanner.l b/src/scanner.l
|
|
Scott Talbert |
2f055b |
index 7c710fa4..70f15d65 100644
|
|
Scott Talbert |
2f055b |
--- a/src/scanner.l
|
|
Scott Talbert |
2f055b |
+++ b/src/scanner.l
|
|
Scott Talbert |
2f055b |
@@ -60,6 +60,9 @@
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
#define USE_STATE2STRING 0
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
+static AtomicInt anonCount;
|
|
Scott Talbert |
2f055b |
+static AtomicInt anonNSCount;
|
|
Scott Talbert |
2f055b |
+
|
|
Scott Talbert |
2f055b |
struct scannerYY_state
|
|
Scott Talbert |
2f055b |
{
|
|
Scott Talbert |
2f055b |
OutlineParserInterface *thisParser;
|
|
Scott Talbert |
2f055b |
@@ -105,8 +108,6 @@ struct scannerYY_state
|
|
Scott Talbert |
2f055b |
int yyBegLineNr = 1 ;
|
|
Scott Talbert |
2f055b |
int yyColNr = 1 ;
|
|
Scott Talbert |
2f055b |
int yyBegColNr = 1 ;
|
|
Scott Talbert |
2f055b |
- int anonCount = 0 ;
|
|
Scott Talbert |
2f055b |
- int anonNSCount = 0 ;
|
|
Scott Talbert |
2f055b |
QCString yyFileName;
|
|
Scott Talbert |
2f055b |
MethodTypes mtype = Method;
|
|
Scott Talbert |
2f055b |
bool stat = false;
|
|
Scott Talbert |
2f055b |
@@ -3784,7 +3785,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Scott Talbert |
2f055b |
BEGIN(MemberSpecSkip);
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
<TypedefName>";" { /* typedef of anonymous type */
|
|
Scott Talbert |
2f055b |
- yyextra->current->name.sprintf("@%d",yyextra->anonCount++);
|
|
Scott Talbert |
2f055b |
+ yyextra->current->name.sprintf("@%d",anonCount++);
|
|
Scott Talbert |
2f055b |
if ((yyextra->current->section == Entry::ENUM_SEC) || (yyextra->current->spec&Entry::Enum))
|
|
Scott Talbert |
2f055b |
{
|
|
Scott Talbert |
2f055b |
yyextra->current->program+=','; // add field terminator
|
|
Scott Talbert |
2f055b |
@@ -3859,7 +3860,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Scott Talbert |
2f055b |
{
|
|
Scott Talbert |
2f055b |
// anonymous compound yyextra->inside -> insert dummy variable name
|
|
Scott Talbert |
2f055b |
//printf("Adding anonymous variable for scope %s\n",p->name.data());
|
|
Scott Talbert |
2f055b |
- yyextra->msName.sprintf("@%d",yyextra->anonCount++);
|
|
Scott Talbert |
2f055b |
+ yyextra->msName.sprintf("@%d",anonCount++);
|
|
Scott Talbert |
2f055b |
break;
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
@@ -5644,12 +5645,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
else // use invisible name
|
|
Scott Talbert |
2f055b |
{
|
|
Scott Talbert |
2f055b |
- yyextra->current->name.sprintf("@%d",yyextra->anonNSCount);
|
|
Scott Talbert |
2f055b |
+ yyextra->current->name.sprintf("@%d",anonNSCount.load());
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
else
|
|
Scott Talbert |
2f055b |
{
|
|
Scott Talbert |
2f055b |
- yyextra->current->name.sprintf("@%d",yyextra->anonCount++);
|
|
Scott Talbert |
2f055b |
+ yyextra->current->name.sprintf("@%d",anonCount++);
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
}
|
|
Scott Talbert |
2f055b |
yyextra->curlyCount=0;
|
|
Scott Talbert |
2f055b |
@@ -7247,7 +7248,6 @@ static void parseMain(yyscan_t yyscanner,
|
|
Scott Talbert |
2f055b |
yyextra->column = 0;
|
|
Scott Talbert |
2f055b |
scannerYYrestart(0,yyscanner);
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
- //yyextra->anonCount = 0; // don't reset per file
|
|
Scott Talbert |
2f055b |
//depthIf = 0;
|
|
Scott Talbert |
2f055b |
yyextra->protection = Public;
|
|
Scott Talbert |
2f055b |
yyextra->mtype = Method;
|
|
Scott Talbert |
2f055b |
@@ -7301,7 +7301,7 @@ static void parseMain(yyscan_t yyscanner,
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
parseCompounds(yyscanner,rt);
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
- yyextra->anonNSCount++;
|
|
Scott Talbert |
2f055b |
+ anonNSCount++;
|
|
Scott Talbert |
2f055b |
|
|
Scott Talbert |
2f055b |
// add additional entries that were created during processing
|
|
Scott Talbert |
2f055b |
for (auto &kv: yyextra->outerScopeEntries)
|
|
Scott Talbert |
2f055b |
--
|
|
Scott Talbert |
2f055b |
2.26.2
|
|
Scott Talbert |
2f055b |
|