Report possible nested comments

This commit is contained in:
Cary R 2021-01-29 18:08:45 -08:00
parent 9e3d6cc996
commit 31a68fcd8a
1 changed files with 3 additions and 1 deletions

View File

@ -179,6 +179,8 @@ TU [munpf]
"/*" { comment_enter = YY_START; BEGIN(CCOMMENT); }
<CCOMMENT>. { ; }
/* Check for a possible nested comment. */
<CCOMMENT>"/*" { VLerror(yylloc, "error: Possible nested comment."); }
<CCOMMENT>\n { yylloc.first_line += 1; }
<CCOMMENT>"*/" { BEGIN(comment_enter); }
@ -259,7 +261,7 @@ TU [munpf]
yylloc.first_line += 1; }
<CSTRING>\n { BEGIN(0);
yylval.text = yytext_string_filter(yytext, yyleng);
VLerror(yylloc, "Missing closing quote for string.");
VLerror(yylloc, "error: Missing closing quote for string.");
yylloc.first_line += 1;
return STRING; }
<CSTRING>\" { BEGIN(0);