Skip to content

Commit a5ef5a0

Browse files
committed
Incorrect handling command character in comment conversion
In case we have a construct like `///@` that should be handled by commentcnv this was not done correctly as the command character was taken a bit early.
1 parent 195cfeb commit a5ef5a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commentcnv.l

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ MAILADDR ("mailto:")?[a-z_A-Z0-9\x80-\xff.+-]+"@"[a-z_A-Z0-9\x80-\xff-]+("."[a
175175
%x SnippetDoc
176176
%x IncludeFile
177177

178+
CMD ("\\"|"@")
178179
//- start: NUMBER -------------------------------------------------------------------------
179180
// Note same defines in code.l: keep in sync
180181
DECIMAL_INTEGER [1-9][0-9']*[0-9]?[uU]?[lL]?[lL]?
@@ -953,7 +954,7 @@ SLASHopt [/]*
953954
yyextra->inRoseComment=false;
954955
BEGIN(Scan);
955956
}
956-
<SComment>\n[ \t]*{CPPC}"/"[^\/\n]/.*\n {
957+
<SComment>\n[ \t]*{CPPC}"/"[^\\@\/\n]/.*\n {
957958
replaceComment(yyscanner,1);
958959
yyextra->readLineCtx=YY_START;
959960
BEGIN(ReadLine);
@@ -1241,6 +1242,7 @@ SLASHopt [/]*
12411242
<ReadLine>`[^`]+` {
12421243
copyToOutput(yyscanner,yytext,yyleng);
12431244
}
1245+
<ReadLine>{CMD}{CMD} |
12441246
<ReadLine>. {
12451247
copyToOutput(yyscanner,yytext,yyleng);
12461248
}

0 commit comments

Comments
 (0)