v0_8 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:
Cary R 2007-10-24 18:39:45 -07:00 committed by Stephen Williams
parent be8c8a8eb7
commit 468e3bb702
1 changed files with 10 additions and 0 deletions

View File

@ -142,6 +142,7 @@ static int comment_enter = 0;
%x PPINCLUDE
%x PPDEFINE
%x CCOMMENT
%x IFCCOMMENT
%x PCOMENT
%x CSTRING
%x ERROR_LINE
@ -314,6 +315,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); }