Mercurial > hg > octave-avbm
diff src/lex.l @ 8974:fde2a916b2ac
include line and file info in parser warnings
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 13 Mar 2009 10:26:59 -0400 |
parents | d865363208d6 |
children | 29563379fa9b |
line wrap: on
line diff
--- a/src/lex.l +++ b/src/lex.l @@ -3377,9 +3377,16 @@ static void gripe_matlab_incompatible (const std::string& msg) { - warning_with_id ("Octave:matlab-incompatible", - "potential Matlab compatibility problem: %s", - msg.c_str ()); + std::string nm = curr_fcn_file_full_name; + + if (nm.empty ()) + warning_with_id ("Octave:matlab-incompatible", + "potential Matlab compatibility problem: %s", + msg.c_str ()); + else + warning_with_id ("Octave:matlab-incompatible", + "potential Matlab compatibility problem: %s near line %d offile %s", + msg.c_str (), input_line_number, nm.c_str ()); } static void