summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-05-14 18:07:43 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-05-14 18:07:43 (GMT)
commitcbf2176f3b053f3a5404b4ec1e01a6522b4ae2cd (patch)
treed8e7ae55f0123728d74e4970ad1dad1c30afc6d4
parent52f38d8f33c324a7cedcb596f606c960386ca652 (diff)
downloadDoxygen-cbf2176f3b053f3a5404b4ec1e01a6522b4ae2cd.zip
Doxygen-cbf2176f3b053f3a5404b4ec1e01a6522b4ae2cd.tar.gz
Doxygen-cbf2176f3b053f3a5404b4ec1e01a6522b4ae2cd.tar.bz2
issue #8552 Javadoc: strange issue with @verbatim ... @endverbatim
The end condition of a block was not detected correctly. in `scanner.l` (and thus `lexscanner.l` too) either the second part was missing or the compete test was missing. Furthermore some conditions weren't handled correctly / incomplete.
-rw-r--r--src/lexscanner.l15
-rw-r--r--src/scanner.l17
2 files changed, 27 insertions, 5 deletions
diff --git a/src/lexscanner.l b/src/lexscanner.l
index 2b6b3a0..44219f3 100644
--- a/src/lexscanner.l
+++ b/src/lexscanner.l
@@ -709,10 +709,18 @@ NONLopt [^\n]*
<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
yyextra->cCodeBuffer += yytext;
yyextra->docBlockName=&yytext[1];
+ if (yyextra->docBlockName.at(1)=='[')
+ {
+ yyextra->docBlockName.at(1)=']';
+ }
if (yyextra->docBlockName.at(1)=='{')
{
yyextra->docBlockName.at(1)='}';
}
+ if (yyextra->docBlockName.at(1)=='(')
+ {
+ yyextra->docBlockName.at(1)=')';
+ }
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
@@ -777,11 +785,14 @@ NONLopt [^\n]*
}
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
yyextra->cCodeBuffer += yytext;
- BEGIN(DocBlock);
+ if (yyextra->docBlockName==&yytext[1])
+ {
+ BEGIN(DocBlock);
+ }
}
<DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
yyextra->cCodeBuffer += yytext;
- if (&yytext[4]==yyextra->docBlockName)
+ if (yyextra->docBlockName==&yytext[4])
{
BEGIN(DocBlock);
}
diff --git a/src/scanner.l b/src/scanner.l
index 00fa3b4..3a927be 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -4543,7 +4543,7 @@ NONLopt [^\n]*
yyextra->docBlockName=&yytext[1];
if (yyextra->docBlockName.at(1)=='[')
{
- yyextra->docBlockName.at(1)='}';
+ yyextra->docBlockName.at(1)=']';
}
if (yyextra->docBlockName.at(1)=='{')
{
@@ -4558,7 +4558,7 @@ NONLopt [^\n]*
}
<CopyArgVerbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode"|"f$"|"f]"|"f}"|"f)")/[^a-z_A-Z0-9\-] { // end of verbatim block
yyextra->fullArgString+=yytext;
- if (yytext[1]=='f') // end of formula
+ if (yytext[1]=='f' && yyextra->docBlockName==&yytext[1])
{
BEGIN(CopyArgCommentLine);
}
@@ -6556,10 +6556,18 @@ NONLopt [^\n]*
<DocBlock>{CMD}("f$"|"f["|"f{"|"f(") {
yyextra->docBlock << yytext;
yyextra->docBlockName=&yytext[1];
+ if (yyextra->docBlockName.at(1)=='[')
+ {
+ yyextra->docBlockName.at(1)=']';
+ }
if (yyextra->docBlockName.at(1)=='{')
{
yyextra->docBlockName.at(1)='}';
}
+ if (yyextra->docBlockName.at(1)=='(')
+ {
+ yyextra->docBlockName.at(1)=')';
+ }
yyextra->fencedSize=0;
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
@@ -6637,7 +6645,10 @@ NONLopt [^\n]*
}
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
yyextra->docBlock << yytext;
- BEGIN(DocBlock);
+ if (yyextra->docBlockName==&yytext[1])
+ {
+ BEGIN(DocBlock);
+ }
}
<DocCopyBlock>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
yyextra->docBlock << yytext;