(process_pp_line): Handle case of string literal with newline
in it in replacement text, which counts as continuing the
replacement text in GNU C.
int
process_pp_line ()
{
- int in_comment = 0;
+ int in_comment = 0, in_string = 0;
int c;
char *p = yytext;
}
}
- while (c && (c != '\n' || in_comment))
+ while (c && (c != '\n' || in_comment || in_string))
{
if (c == '\\')
GET (c);
if (GET (c) == '/')
in_comment = 0;
}
+ else if (c == '"')
+ in_string = !in_string;
if (c == '\n')
INCREMENT_LINENO;
GET (c);
}
-
+
return c;
}
else switch (c)
{
case '\n':
+ INCREMENT_LINENO;
case 'a':
case 'b':
case 'f':
else
yyerror ("newline in string constant");
INCREMENT_LINENO;
- goto end_string;
+ break;
default:
break;