Skip to content

Commit 5af1d31

Browse files
committed
issue doxygen#11169 How to copydoc documentation of functions with spaces?
1 parent 41b54df commit 5af1d31

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/docparser.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,11 +1754,13 @@ static QCString extractCopyDocId(const char *data, size_t &j, size_t len)
17541754
case '\'': insideSQuote=TRUE; break;
17551755
case '\\': // fall through, begin of command
17561756
case '@': // fall through, begin of command
1757-
case ' ': // fall through
17581757
case '\t': // fall through
17591758
case '\n':
17601759
found=(round==0);
17611760
break;
1761+
case ' ': // allow spaces in cast operator (see issue #11169)
1762+
found=(round==0) && (j<8 || qstrncmp(data+j-8,"operator",8)!=0);
1763+
break;
17621764
}
17631765
}
17641766
else if (insideSQuote) // look for single quote end
@@ -1777,6 +1779,8 @@ static QCString extractCopyDocId(const char *data, size_t &j, size_t len)
17771779
}
17781780
if (!found) j++;
17791781
}
1782+
1783+
// include const and volatile
17801784
if (qstrncmp(data+j," const",6)==0)
17811785
{
17821786
j+=6;
@@ -1785,8 +1789,16 @@ static QCString extractCopyDocId(const char *data, size_t &j, size_t len)
17851789
{
17861790
j+=9;
17871791
}
1792+
1793+
// allow '&' or '&&' or ' &' or ' &&' at the end
1794+
size_t k=j;
1795+
while (k<len && data[k]==' ') k++;
1796+
if (k<len-1 && data[k]=='&' && data[k+1]=='&') j=k+2;
1797+
else if (k<len && data[k]=='&' ) j=k+1;
1798+
1799+
// do not include punctuation added by Definition::_setBriefDescription()
17881800
size_t e=j;
1789-
if (j>0 && data[j-1]=='.') { e--; } // do not include punctuation added by Definition::_setBriefDescription()
1801+
if (j>0 && data[j-1]=='.') { e--; }
17901802
QCString id(data+s,e-s);
17911803
//printf("extractCopyDocId='%s' input='%s'\n",qPrint(id),&data[s]);
17921804
return id;

0 commit comments

Comments
 (0)