diff src/lex.l @ 3813:8986086e3e0f

[project @ 2001-04-19 02:21:40 by jwe]
author jwe
date Thu, 19 Apr 2001 02:21:41 +0000
parents 44386b0e53da
children 81552337b120
line wrap: on
line diff
--- a/src/lex.l
+++ b/src/lex.l
@@ -719,9 +719,13 @@
 . {
     current_input_column++;
 
-    error ("invalid character `%s' (ASCII %d) near line %d, column %d",
-	   undo_string_escape (yytext[0]), static_cast<int> (yytext[0]),
-	   input_line_number, current_input_column);
+    if (static_cast<int> (yytext[0]) == EOF)
+      error ("unexpected end of file near line %d, column %d",
+	     input_line_number, current_input_column);
+    else
+      error ("invalid character `%s' (ASCII %d) near line %d, column %d",
+	     undo_string_escape (yytext[0]), static_cast<int> (yytext[0]),
+	     input_line_number, current_input_column);
 
     return LEXICAL_ERROR;
   }