From aa00bcb575b4bdf85a784eeec109c6782de89924 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 10 Mar 2021 12:01:20 +0100 Subject: Problem with non escaped double quote in preprocessor When having the (lex) program like: ``` %% [\"] {} %% #ifdef SHARED_OBJECT int filter_func(FILE *in, FILE *out) { /* " */ } #else int main(void) { } #endif ``` we get the messages like: ``` .../htuml2txt.lex:11: warning: Found an #else without a preceding #if. .../htuml2txt.lex:13: warning: More #endif's than #if's found. ``` due to the fact that the escaped double quote is not seen as an escaped character. --- src/pre.l | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pre.l b/src/pre.l index b153942..9a60750 100644 --- a/src/pre.l +++ b/src/pre.l @@ -621,6 +621,9 @@ WSopt [ \t\r]* "\\"\r?/\n { // strip line continuation characters if (getLanguageFromFileName(yyextra->yyFileName)==SrcLangExt_Fortran) outputChar(yyscanner,*yytext); } +\\. { + outputArray(yyscanner,yytext,(int)yyleng); + } . { outputChar(yyscanner,*yytext); } -- cgit v0.12