Skip to content

Commit 2711127

Browse files
committed
issue #6737 */ inside code block
The warning regarding the nested comment block was already removed, though the `*` in the second and further lines in the block remained (also the one in front of the `end` command was still present small example: ``` * @code * root_group->remove("*/stepper_motor/*"); * root_group->remove("*/stepper_motor/*"); * @Endcode ``` - removed the `*` - reset the block name when reaching the `end` command.
1 parent 9a5686a commit 2711127

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/scanner.l

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4751,13 +4751,15 @@ NONLopt [^\n]*
47514751
yyextra->fullArgString+=yytext;
47524752
if (&yytext[4]==yyextra->docBlockName)
47534753
{
4754+
yyextra->docBlockName="";
47544755
BEGIN(CopyArgCommentLine);
47554756
}
47564757
}
47574758
<CopyArgVerbatim>[\\@]("f$"|"f]"|"f}"|"f)") { // end of verbatim block
47584759
yyextra->fullArgString+=yytext;
47594760
if (yyextra->docBlockName==&yytext[1])
47604761
{
4762+
yyextra->docBlockName="";
47614763
BEGIN(CopyArgCommentLine);
47624764
}
47634765
}
@@ -6860,27 +6862,31 @@ NONLopt [^\n]*
68606862
yyextra->docBlock << yytext;
68616863
if (yyextra->docBlockName=="<pre>")
68626864
{
6865+
yyextra->docBlockName="";
68636866
BEGIN(DocBlock);
68646867
}
68656868
}
68666869
<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
68676870
yyextra->docBlock << yytext;
68686871
if (yyextra->docBlockName=="<code>")
68696872
{
6873+
yyextra->docBlockName="";
68706874
BEGIN(DocBlock);
68716875
}
68726876
}
68736877
<DocCopyBlock>[\\@]("f$"|"f]"|"f}"|"f)") {
68746878
yyextra->docBlock << yytext;
68756879
if (yyextra->docBlockName==&yytext[1])
68766880
{
6881+
yyextra->docBlockName="";
68776882
BEGIN(DocBlock);
68786883
}
68796884
}
68806885
<DocCopyBlock>[\\@]("endverbatim"|"endiliteral"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endmanonly"|"endrtfonly"|"enddot"|"endmsc"|"enduml"|"endcode")/[^a-z_A-Z0-9] { // end of verbatim block
68816886
yyextra->docBlock << yytext;
68826887
if (&yytext[4]==yyextra->docBlockName)
68836888
{
6889+
yyextra->docBlockName="";
68846890
BEGIN(DocBlock);
68856891
}
68866892
}
@@ -6959,14 +6965,17 @@ NONLopt [^\n]*
69596965
<DocCopyBlock>[^\<@/\*\]~\$\\\n]+ { // any character that is not special
69606966
yyextra->docBlock << yytext;
69616967
}
6962-
<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
6963-
if (yytext[1]=='*')
6968+
<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
6969+
if (!((yyextra->docBlockName=="code") || (yyextra->docBlockName=="iliteral")))
69646970
{
6965-
yyextra->nestedComment=TRUE;
6966-
}
6967-
else if (yytext[0]=='*')
6968-
{
6969-
yyextra->nestedComment=FALSE;
6971+
if (yytext[1]=='*')
6972+
{
6973+
yyextra->nestedComment=true;
6974+
}
6975+
else if (yytext[0]=='*')
6976+
{
6977+
yyextra->nestedComment=false;
6978+
}
69706979
}
69716980
yyextra->docBlock << yytext;
69726981
}

0 commit comments

Comments
 (0)