1999-12-13 Mumit Khan <khan@xraylith.wisc.edu>
authorkhan <khan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Dec 1999 05:33:22 +0000 (05:33 +0000)
committerkhan <khan@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Dec 1999 05:33:22 +0000 (05:33 +0000)
* lex.c (saving_parse_to_obstack): New global.
(reinit_parse_for_block): Use.
(reinit_parse_for_expr): Use.
(check_newline): Use.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30896 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/lex.c

index 9521c19..7f5425e 100644 (file)
@@ -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
index 8d212ce..a6a1d28 100644 (file)
@@ -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;
     }