aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMumit Khan <khan@xraylith.wisc.edu>1999-12-14 05:33:22 +0000
committerMumit Khan <khan@gcc.gnu.org>1999-12-14 05:33:22 +0000
commit0b807ad8437c26a2bd81f154b604d5bebdb2a2cd (patch)
tree584103397f4fdf00e876da66b5e7c60cf519d95a
parent0f7db4884e2a2f3a1b45ca5eaf50b64f0fcdeef0 (diff)
downloadgcc-0b807ad8437c26a2bd81f154b604d5bebdb2a2cd.zip
gcc-0b807ad8437c26a2bd81f154b604d5bebdb2a2cd.tar.gz
gcc-0b807ad8437c26a2bd81f154b604d5bebdb2a2cd.tar.bz2
lex.c (saving_parse_to_obstack): New global.
1999-12-13 Mumit Khan <khan@xraylith.wisc.edu> * lex.c (saving_parse_to_obstack): New global. (reinit_parse_for_block): Use. (reinit_parse_for_expr): Use. (check_newline): Use. From-SVN: r30896
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/lex.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9521c19..7f5425e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+1999-12-13 Mumit Khan <khan@xraylith.wisc.edu>
+
+ * lex.c (saving_parse_to_obstack): New global.
+ (reinit_parse_for_block): Use.
+ (reinit_parse_for_expr): Use.
+ (check_newline): Use.
+
1999-12-13 Mark Mitchell <mark@codesourcery.com>
* optimize.c (initialize_inlined_parameters): Take FN to which the
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 8d212ce..a6a1d28 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -113,6 +113,9 @@ file_name_nondirectory (x)
struct obstack inline_text_obstack;
char *inline_text_firstobj;
+/* Nonzero if parse output is being saved to an obstack for later parsing. */
+static int saving_parse_to_obstack = 0;
+
#if USE_CPPLIB
#include "cpplib.h"
extern cpp_reader parse_in;
@@ -1618,7 +1621,9 @@ reinit_parse_for_block (pyychar, obstackp)
{
int this_lineno = lineno;
+ saving_parse_to_obstack = 1;
c = skip_white_space (c);
+ saving_parse_to_obstack = 0;
/* Don't lose our cool if there are lots of comments. */
if (lineno == this_lineno + 1)
@@ -1747,7 +1752,9 @@ reinit_parse_for_expr (obstackp)
{
int this_lineno = lineno;
+ saving_parse_to_obstack = 1;
c = skip_white_space (c);
+ saving_parse_to_obstack = 0;
/* Don't lose our cool if there are lots of comments. */
if (lineno == this_lineno + 1)
@@ -2489,10 +2496,11 @@ linenum:
(2) I don't know how well that would work in the presense
of filenames that contain wide characters. */
- if (saw_line)
+ if (saw_line || saving_parse_to_obstack)
{
/* Don't treat \ as special if we are processing #line 1 "...".
- If you want it to be treated specially, use # 1 "...". */
+ If you want it to be treated specially, use # 1 "...". Also
+ ignore these if saving to an obstack for later parsing. */
ignore_escape_flag = 1;
}