# HG changeset patch # User Gerd Moellmann # Date 963261418 0 # Node ID d0076702941837d5c2fea0a343a0a423677e21fa # Parent 4a3808257cf457f1801a96b1d49148b9bb5773c2 (yylex): Accept string literals with newlines in them. (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. diff -r 4a3808257cf4 -r d00767029418 lib-src/ebrowse.c --- a/lib-src/ebrowse.c Mon Jul 10 20:32:14 2000 +0000 +++ b/lib-src/ebrowse.c Mon Jul 10 20:36:58 2000 +0000 @@ -1462,7 +1462,7 @@ int process_pp_line () { - int in_comment = 0; + int in_comment = 0, in_string = 0; int c; char *p = yytext; @@ -1501,7 +1501,7 @@ } } - while (c && (c != '\n' || in_comment)) + while (c && (c != '\n' || in_comment || in_string)) { if (c == '\\') GET (c); @@ -1515,13 +1515,15 @@ if (GET (c) == '/') in_comment = 0; } + else if (c == '"') + in_string = !in_string; if (c == '\n') INCREMENT_LINENO; GET (c); } - + return c; } @@ -1579,6 +1581,7 @@ else switch (c) { case '\n': + INCREMENT_LINENO; case 'a': case 'b': case 'f': @@ -1641,7 +1644,7 @@ else yyerror ("newline in string constant"); INCREMENT_LINENO; - goto end_string; + break; default: break;