Make C style comments work in false/suppressed ifdef/etc. blocks.
C style comments were not recognized as comments in false or suppressed sections of ifdef/etc. blocks. This prohibited an unneeded endif/else/etc. from being commented out with this style of comment.
This commit is contained in:
parent
347ba8bc29
commit
3f6ea1d587
|
|
@ -149,6 +149,7 @@ static int comment_enter = 0;
|
|||
%x PPINCLUDE
|
||||
%x PPDEFINE
|
||||
%x CCOMMENT
|
||||
%x IFCCOMMENT
|
||||
%x PCOMENT
|
||||
%x CSTRING
|
||||
%x ERROR_LINE
|
||||
|
|
@ -338,6 +339,15 @@ W [ \t\b\f]+
|
|||
<IFDEF_SUPR>`else { }
|
||||
|
||||
<IFDEF_FALSE,IFDEF_SUPR>"//"[^\r\n]* { }
|
||||
|
||||
<IFDEF_FALSE,IFDEF_SUPR>"/*" { comment_enter = YY_START; BEGIN(IFCCOMMENT); }
|
||||
<IFCCOMMENT>[^\r\n] { }
|
||||
<IFCCOMMENT>\n\r { istack->lineno += 1; }
|
||||
<IFCCOMMENT>\r\n { istack->lineno += 1; }
|
||||
<IFCCOMMENT>\n { istack->lineno += 1; }
|
||||
<IFCCOMMENT>\r { istack->lineno += 1; }
|
||||
<IFCCOMMENT>"*/" { BEGIN(comment_enter); }
|
||||
|
||||
<IFDEF_FALSE,IFDEF_SUPR>[^\r\n] { }
|
||||
<IFDEF_FALSE,IFDEF_SUPR>\n\r { istack->lineno += 1; fputc('\n', yyout); }
|
||||
<IFDEF_FALSE,IFDEF_SUPR>\r\n { istack->lineno += 1; fputc('\n', yyout); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue