# HG changeset patch # User jwe # Date 987646901 0 # Node ID 8986086e3e0f552a46dd69c54ce53b8dbff1bb49 # Parent 23994b10c8b7a133e3d4c46ec7cd7116464d9692 [project @ 2001-04-19 02:21:40 by jwe] diff -r 23994b10c8b7 -r 8986086e3e0f src/ChangeLog --- a/src/ChangeLog Wed Apr 18 18:43:52 2001 +0000 +++ b/src/ChangeLog Thu Apr 19 02:21:41 2001 +0000 @@ -1,3 +1,8 @@ +2001-04-18 John W. Eaton + + * lex.l: If unexpected character is EOF, report EOF error instead + of invalid character error. + 2001-04-18 Mumit Khan * load-save.cc (read_mat5_binary_element): Cast arguments to the diff -r 23994b10c8b7 -r 8986086e3e0f src/lex.l --- a/src/lex.l Wed Apr 18 18:43:52 2001 +0000 +++ b/src/lex.l Thu Apr 19 02:21:41 2001 +0000 @@ -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 (yytext[0]), - input_line_number, current_input_column); + if (static_cast (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 (yytext[0]), + input_line_number, current_input_column); return LEXICAL_ERROR; }