diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 243049a47b2..1a048604e59 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -150,6 +150,7 @@ %x pp_macexp %x pp_if %x pp_ifd +%x pp_ifignored %x pp_endif %x pp_line %x pp_defined @@ -390,7 +391,7 @@ void pp_writestring(const char *format, ...) {ws}*undef{ws}* if(yy_top_state() != pp_ignore) {yy_pp_state(pp_ifd); return tUNDEF;} else {yy_pp_state(pp_eol);} {ws}*ifdef{ws}* yy_pp_state(pp_ifd); return tIFDEF; {ws}*ifndef{ws}* pp_incl_state.seen_junk--; yy_pp_state(pp_ifd); return tIFNDEF; -{ws}*if{ws}* yy_pp_state(pp_if); return tIF; +{ws}*if{ws}* if(yy_top_state() != pp_ignore) {yy_pp_state(pp_if);} else {yy_pp_state(pp_ifignored);} return tIF; {ws}*elif{ws}* yy_pp_state(pp_if); return tELIF; {ws}*else{ws}* yy_pp_state(pp_endif); return tELSE; {ws}*endif{ws}* yy_pp_state(pp_endif); return tENDIF; @@ -450,6 +451,9 @@ void pp_writestring(const char *format, ...) \" ppy_error("String constants not allowed in conditionals"); . return *ppy_text; +[^\n]+ ppy_lval.sint = 0; return tSINT; +\n newline(1); yy_pop_state(); return tNL; + /* * Handle #ifdef, #ifndef and #undef * to get only an untranslated/unexpanded identifier