changeset 4248:eef64f3f9a4c

[project @ 2002-12-31 00:00:20 by jwe]
author jwe
date Tue, 31 Dec 2002 00:00:20 +0000
parents fc9a075d10fb
children 8a1ef8fe4036
files src/ChangeLog src/lex.l
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Dec 30 23:05:27 2002 +0000
+++ b/src/ChangeLog	Tue Dec 31 00:00:20 2002 +0000
@@ -1,5 +1,7 @@
 2002-12-30  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* lex.l (.): Try another approach to handling EOF here.
+
 	* load-save.cc (read_mat_ascii_data): Use isalpha and isalnum, not
 	::isalpha and ::isalnum.
 
--- a/src/lex.l	Mon Dec 30 23:05:27 2002 +0000
+++ b/src/lex.l	Tue Dec 31 00:00:20 2002 +0000
@@ -792,12 +792,16 @@
 . {
     // EOF happens here if we are parsing nested functions.
 
-    if (yytext[0] != EOF)
+    unput (yytext[0]);
+
+    int c = yyinput ();
+
+    if (c != EOF)
       {
 	current_input_column++;
 
 	error ("invalid character `%s' (ASCII %d) near line %d, column %d",
-	       undo_string_escape (yytext[0]), static_cast<int> (yytext[0]),
+	       undo_string_escape (static_cast<char> (c)), c,
 	       input_line_number, current_input_column);
 
 	return LEXICAL_ERROR;