Skip to content

Commit 17eff36

Browse files
committed
issue #9831 @exception description paragraph does not accept @ref tag
Handle the `"""` in the comment converter properly in case `PYTHON_DOCSTRING=NO` so e.g. `ALIASES` are converted as well.
1 parent f40290b commit 17eff36

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

Diff for: src/commentcnv.l

+25-1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,25 @@ SLASHopt [/]*
221221
yyextra->commentStack.push(yyextra->lineNr);
222222
}
223223
}
224+
<Scan>"\"\"\"" { /* start of python long comment */
225+
if (yyextra->lang!=SrcLangExt_Python)
226+
{
227+
REJECT;
228+
}
229+
else if (Config_getBool(PYTHON_DOCSTRING))
230+
{
231+
REJECT;
232+
}
233+
else
234+
{ /* handle as if """! */
235+
yyextra->pythonDocString = TRUE;
236+
yyextra->nestingCount=1;
237+
clearCommentStack(yyscanner); /* to be on the save side */
238+
copyToOutput(yyscanner,yytext,(int)yyleng);
239+
BEGIN(CComment);
240+
yyextra->commentStack.push(yyextra->lineNr);
241+
}
242+
}
224243
<Scan>![><!]/.*\n {
225244
if (yyextra->lang!=SrcLangExt_Fortran)
226245
{
@@ -1214,7 +1233,12 @@ void convertCppComments(const BufStr &inBuf,BufStr &outBuf,const QCString &fileN
12141233
clearCommentStack(yyscanner);
12151234
yyextra->vhdl = FALSE;
12161235

1217-
DebugLex debugLex(Debug::Lex_commentcnv,__FILE__, qPrint(fileName));
1236+
if (Debug::isFlagSet(Debug::CommentCnv))
1237+
{
1238+
Debug::print(Debug::CommentCnv,0,"-----------\nCommentCnv: %s\n"
1239+
"input=[\n%s]\n-----------\n",qPrint(fileName),yyextra->inBuf.data()
1240+
);
1241+
}
12181242
yyextra->isFixedForm = FALSE;
12191243
if (yyextra->lang==SrcLangExt_Fortran)
12201244
{

0 commit comments

Comments
 (0)