From 468e3bb702908636017a441fd1ff9072fe15f306 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 24 Oct 2007 18:39:45 -0700 Subject: [PATCH] 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. --- ivlpp/lexor.lex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ivlpp/lexor.lex b/ivlpp/lexor.lex index ba013738d..2b0ff086f 100644 --- a/ivlpp/lexor.lex +++ b/ivlpp/lexor.lex @@ -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]+ `else { } "//"[^\r\n]* { } + +"/*" { comment_enter = YY_START; BEGIN(IFCCOMMENT); } +[^\r\n] { } +\n\r { istack->lineno += 1; } +\r\n { istack->lineno += 1; } +\n { istack->lineno += 1; } +\r { istack->lineno += 1; } +"*/" { BEGIN(comment_enter); } + [^\r\n] { } \n\r { istack->lineno += 1; fputc('\n', yyout); } \r\n { istack->lineno += 1; fputc('\n', yyout); }