Mercurial > hg > octave-nkf
changeset 3813:8986086e3e0f
[project @ 2001-04-19 02:21:40 by jwe]
author | jwe |
---|---|
date | Thu, 19 Apr 2001 02:21:41 +0000 |
parents | 23994b10c8b7 |
children | fb01838d0f38 |
files | src/ChangeLog src/lex.l |
diffstat | 2 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-04-18 John W. Eaton <jwe@bevo.che.wisc.edu> + + * lex.l: If unexpected character is EOF, report EOF error instead + of invalid character error. + 2001-04-18 Mumit Khan <khan@nanotech.wisc.edu> * load-save.cc (read_mat5_binary_element): Cast arguments to the
--- 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; }