# HG changeset patch # User jwe # Date 1074830907 0 # Node ID 9759e52e19bc20e17d05bde970f16e046ecda1b0 # Parent ab71705f294f9703898ff66b99a41cbb822f15e7 [project @ 2004-01-23 04:08:27 by jwe] diff -r ab71705f294f -r 9759e52e19bc src/ChangeLog --- a/src/ChangeLog Fri Jan 23 03:21:05 2004 +0000 +++ b/src/ChangeLog Fri Jan 23 04:08:27 2004 +0000 @@ -1,5 +1,8 @@ 2004-01-22 John W. Eaton + * error.cc (pr_where): New arg, print_code with default value true. + (warning): Call pr_where with second arg false. + * file-io.cc (Ffrewind): Only return value if nargout > 0. (Ffprintf): Likewise. (Fprintf): Likewise. diff -r ab71705f294f -r 9759e52e19bc src/error.cc --- a/src/error.cc Fri Jan 23 03:21:05 2004 +0000 +++ b/src/error.cc Fri Jan 23 04:08:27 2004 +0000 @@ -313,7 +313,7 @@ } static void -pr_where (const char *name) +pr_where (const char *name, bool print_code = true) { if (curr_statement) { @@ -335,25 +335,28 @@ else pr_where_1 ("%s: near line %d, column %d:", name, l, c); - // XXX FIXME XXX -- Note that the column number is probably not - // going to mean much here since the code is being reproduced - // from the parse tree, and we are only showing one statement - // even if there were multiple statements on the original source - // line. + if (print_code) + { + // XXX FIXME XXX -- Note that the column number is probably + // not going to mean much here since the code is being + // reproduced from the parse tree, and we are only showing + // one statement even if there were multiple statements on + // the original source line. - OSSTREAM output_buf; - - output_buf << std::endl; + OSSTREAM output_buf; - tree_print_code tpc (output_buf, ">>> "); + output_buf << std::endl; - curr_statement->accept (tpc); + tree_print_code tpc (output_buf, ">>> "); + + curr_statement->accept (tpc); - output_buf << std::endl << OSSTREAM_ENDS; + output_buf << std::endl << OSSTREAM_ENDS; - pr_where_1 ("%s", OSSTREAM_C_STR (output_buf)); + pr_where_1 ("%s", OSSTREAM_C_STR (output_buf)); - OSSTREAM_FREEZE (output_buf); + OSSTREAM_FREEZE (output_buf); + } } } @@ -366,7 +369,7 @@ && Vwarning_option == "backtrace" && ! warning_state && ! discard_warning_messages) - pr_where ("warning"); + pr_where ("warning", false); va_list args; va_start (args, fmt);