summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-05-02 09:33:10 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-05-02 09:33:10 (GMT)
commit77c1e773565b2e464cc19d5e897ff7ba3bfb93fc (patch)
treedc14de1ea2b424b3d0c4244852c56d7e2799ebae
parent054e6f10845218f0a39898030830200313261c62 (diff)
parente042aeceae7bb0dbee8e7602d3a20b388b94eb82 (diff)
downloadDoxygen-77c1e773565b2e464cc19d5e897ff7ba3bfb93fc.zip
Doxygen-77c1e773565b2e464cc19d5e897ff7ba3bfb93fc.tar.gz
Doxygen-77c1e773565b2e464cc19d5e897ff7ba3bfb93fc.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
-rw-r--r--src/docparser.cpp16
-rw-r--r--src/doxygen.cpp10
-rw-r--r--src/scanner.l12
-rw-r--r--src/sqlite3gen.cpp1
-rw-r--r--src/symbolresolver.cpp1
-rw-r--r--src/util.cpp24
-rw-r--r--src/xmlgen.cpp1
7 files changed, 58 insertions, 7 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index de28a65..a812406 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -724,7 +724,21 @@ static bool findDocsForMemberOrCompound(const QCString &commandName,
// for symbols we need to normalize the separator, so A#B, or A\B, or A.B becomes A::B
cmdArg = substitute(cmdArg,"#","::");
cmdArg = substitute(cmdArg,"\\","::");
- cmdArg = substitute(cmdArg,".","::");
+ static bool extractAnonNs = Config_getBool(EXTRACT_ANON_NSPACES);
+ if (extractAnonNs &&
+ cmdArg.startsWith("anonymous_namespace{")
+ )
+ {
+ int rightBracePos = cmdArg.find("}", std::strlen("anonymous_namespace{"));
+ QCString leftPart = cmdArg.left(rightBracePos + 1);
+ QCString rightPart = cmdArg.right(cmdArg.size() - rightBracePos - 1);
+ rightPart = substitute(rightPart, ".", "::");
+ cmdArg = leftPart + rightPart;
+ }
+ else
+ {
+ cmdArg = substitute(cmdArg,".","::");
+ }
int l=(int)cmdArg.length();
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 8835b05..51fcd16 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -2729,10 +2729,12 @@ static bool isVarWithConstructor(const Entry *root)
if (reg::search(resType,match,idChars) && match.position()==0) // resType starts with identifier
{
resType=match.str();
- //printf("resType=%s\n",qPrint(resType));
- if (resType=="int" || resType=="long" || resType=="float" ||
- resType=="double" || resType=="char" || resType=="signed" ||
- resType=="const" || resType=="unsigned" || resType=="void")
+ //printf("resType=%s\n",resType.data());
+ if (resType=="int" || resType=="long" ||
+ resType=="float" || resType=="double" ||
+ resType=="char" || resType=="void" ||
+ resType=="signed" || resType=="unsigned" ||
+ resType=="const" || resType=="volatile" )
{
result=FALSE; // type keyword -> function prototype
goto done;
diff --git a/src/scanner.l b/src/scanner.l
index fdd8b93..00fa3b4 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -2317,6 +2317,18 @@ NONLopt [^\n]*
}
yyextra->current->name=yyextra->current->name.mid(6);
}
+ else if (yyextra->current->name.left(9)=="volatile ")
+ {
+ if (yyextra->current->type.isEmpty())
+ {
+ yyextra->current->type="volatile";
+ }
+ else
+ {
+ yyextra->current->type+="volatile ";
+ }
+ yyextra->current->name=yyextra->current->name.mid(9);
+ }
}
QCString tmp=yytext;
if (nameIsOperator(tmp))
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index 7824fca..6943fb9 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -1136,7 +1136,6 @@ static void stripQualifiers(QCString &typeStr)
{
if (typeStr.stripPrefix("static "));
else if (typeStr.stripPrefix("virtual "));
- else if (typeStr.stripPrefix("volatile "));
else if (typeStr=="virtual") typeStr="";
else done=TRUE;
}
diff --git a/src/symbolresolver.cpp b/src/symbolresolver.cpp
index f509c7d..17843a1 100644
--- a/src/symbolresolver.cpp
+++ b/src/symbolresolver.cpp
@@ -533,6 +533,7 @@ const ClassDef *SymbolResolver::Private::newResolveTypedef(
}
type=type.left(ip+1);
type.stripPrefix("const "); // strip leading "const"
+ type.stripPrefix("volatile "); // strip leading "volatile"
type.stripPrefix("struct "); // strip leading "struct"
type.stripPrefix("union "); // strip leading "union"
int sp=0;
diff --git a/src/util.cpp b/src/util.cpp
index 9941d09..37c5e62 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -495,6 +495,7 @@ int computeQualifiedIndex(const QCString &name)
//-------------------------------------------------------------------------
static const char constScope[] = { 'c', 'o', 'n', 's', 't', ':' };
+static const char volatileScope[] = { 'v', 'o', 'l', 'a', 't', 'i', 'l', 'e', ':' };
static const char virtualScope[] = { 'v', 'i', 'r', 't', 'u', 'a', 'l', ':' };
static const char operatorScope[] = { 'o', 'p', 'e', 'r', 'a', 't', 'o', 'r', '?', '?', '?' };
@@ -565,6 +566,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
uint i=0;
uint l=s.length();
uint csp=0;
+ uint vosp=0;
uint vsp=0;
uint osp=0;
char c;
@@ -590,6 +592,16 @@ QCString removeRedundantWhiteSpace(const QCString &s)
else // reset counter
csp=0;
+ if (vosp<6 && c==volatileScope[vosp] && // character matches substring "volatile"
+ (vosp>0 || // inside search string
+ i==0 || // if it is the first character
+ !isId(pc) // the previous may not be a digit
+ )
+ )
+ vosp++;
+ else // reset counter
+ vosp=0;
+
// search for "virtual"
if (vsp<8 && c==virtualScope[vsp] && // character matches substring "virtual"
(vsp>0 || // inside search string
@@ -727,6 +739,11 @@ QCString removeRedundantWhiteSpace(const QCString &s)
*dst++=' ';
csp=0;
}
+ else if (vosp==9) // replace volatile::A by volatile ::A
+ {
+ *dst++=' ';
+ vosp=0;
+ }
else if (vsp==8) // replace virtual::A by virtual ::A
{
*dst++=' ';
@@ -764,6 +781,13 @@ QCString removeRedundantWhiteSpace(const QCString &s)
*dst++=' ';
csp=0;
}
+ else if (c=='e' && vosp==8 && i<l-1 && // found 'e' in 'volatile'
+ !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
+ ) // prevent volatile ::A from being converted to volatile::A
+ {
+ *dst++=' ';
+ vosp=0;
+ }
else if (c=='l' && vsp==7 && i<l-1 && // found 'l' in 'virtual'
!(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
) // prevent virtual ::A from being converted to virtual::A
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 86f3081..46b0084 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -489,7 +489,6 @@ static void stripQualifiers(QCString &typeStr)
{
if (typeStr.stripPrefix("static "));
else if (typeStr.stripPrefix("virtual "));
- else if (typeStr.stripPrefix("volatile "));
else if (typeStr=="virtual") typeStr="";
else done=TRUE;
}