summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-07-10 20:36:58 +0000
committerGerd Moellmann <gerd@gnu.org>2000-07-10 20:36:58 +0000
commit43c378d37bb4aa342561eafd3aa7495e0450d73f (patch)
tree514af0342d763e8c1fc47211b921f9128346e682 /lib-src
parentbc8b525575302fff2a343a7f2b64d626754bcba0 (diff)
downloademacs-43c378d37bb4aa342561eafd3aa7495e0450d73f.tar.gz
(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.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ebrowse.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 8ebe5ff8991..8dcd830793e 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -1462,7 +1462,7 @@ do { \
int
process_pp_line ()
{
- int in_comment = 0;
+ int in_comment = 0, in_string = 0;
int c;
char *p = yytext;
@@ -1501,7 +1501,7 @@ process_pp_line ()
}
}
- while (c && (c != '\n' || in_comment))
+ while (c && (c != '\n' || in_comment || in_string))
{
if (c == '\\')
GET (c);
@@ -1515,13 +1515,15 @@ process_pp_line ()
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 @@ yylex ()
else switch (c)
{
case '\n':
+ INCREMENT_LINENO;
case 'a':
case 'b':
case 'f':
@@ -1641,7 +1644,7 @@ yylex ()
else
yyerror ("newline in string constant");
INCREMENT_LINENO;
- goto end_string;
+ break;
default:
break;