Commit 7140b0db by Zack Weinberg Committed by Dave Brolley

lex.c: Call check_newline from lang_init always.

1998-10-28  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cp/lex.c: Call check_newline from lang_init always.	After
	calling cpp_start_read, set yy_cur and yy_lim to read from the
	cpplib token buffer.

From-SVN: r23425
parent add7091b
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
* Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@, * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@,
last. last.
1998-10-28 Zack Weinberg <zack@rabi.phys.columbia.edu>
* cp/lex.c: Call check_newline from lang_init always. After
calling cpp_start_read, set yy_cur and yy_lim to read from the
cpplib token buffer.
1998-10-28 Jason Merrill <jason@yorick.cygnus.com> 1998-10-28 Jason Merrill <jason@yorick.cygnus.com>
* class.c (instantiate_type): Don't consider templates for a normal * class.c (instantiate_type): Don't consider templates for a normal
......
...@@ -395,11 +395,14 @@ lang_init_options () ...@@ -395,11 +395,14 @@ lang_init_options ()
void void
lang_init () lang_init ()
{ {
#if ! USE_CPPLIB
/* the beginning of the file is a new line; check for # */ /* the beginning of the file is a new line; check for # */
/* With luck, we discover the real source file's name from that /* With luck, we discover the real source file's name from that
and put it in input_filename. */ and put it in input_filename. */
#if ! USE_CPPLIB
put_back (check_newline ()); put_back (check_newline ());
#else
check_newline ();
yy_cur--;
#endif #endif
if (flag_gnu_xref) GNU_xref_begin (input_filename); if (flag_gnu_xref) GNU_xref_begin (input_filename);
init_repo (input_filename); init_repo (input_filename);
...@@ -475,12 +478,15 @@ init_parse (filename) ...@@ -475,12 +478,15 @@ init_parse (filename)
#endif #endif
#if USE_CPPLIB #if USE_CPPLIB
yy_cur = "\n";
yy_lim = yy_cur + 1;
parse_in.show_column = 1; parse_in.show_column = 1;
if (! cpp_start_read (&parse_in, filename)) if (! cpp_start_read (&parse_in, filename))
abort (); abort ();
/* cpp_start_read always puts at least one line directive into the
token buffer. We must arrange to read it out here. */
yy_cur = parse_in.token_buffer;
yy_lim = CPP_PWRITTEN (&parse_in);
#else #else
/* Open input file. */ /* Open input file. */
if (filename == 0 || !strcmp (filename, "-")) if (filename == 0 || !strcmp (filename, "-"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment