# HG changeset patch # User jwe # Date 863724153 0 # Node ID ae2471c4e5c0b580d8291c98307a685961e36927 # Parent f2be17e6f1ea7239176f539a788e721a538fafc6 [project @ 1997-05-15 19:22:05 by jwe] diff -r f2be17e6f1ea -r ae2471c4e5c0 src/pt-indir.cc --- a/src/pt-indir.cc Thu May 15 18:55:47 1997 +0000 +++ b/src/pt-indir.cc Thu May 15 19:22:33 1997 +0000 @@ -61,13 +61,13 @@ octave_value_list retval; if (nargout > 1) - error ("%s, %s", __FILE__, __LINE__); + error ("invalid number of output arguments for structure reference"); else { octave_value_list tmp = expr->rvalue (nargout); if (tmp.empty ()) - error ("%s, %s", __FILE__, __LINE__); + eval_error (); else { octave_value val = tmp(0).do_struct_elt_index_op (nm); @@ -112,6 +112,14 @@ tw.visit_indirect_ref (*this); } +void +tree_indirect_ref::eval_error (void) const +{ + if (error_state > 0) + ::error ("evaluating structure reference operator near line %d, column %d", + oper () . c_str (), line (), column ()); +} + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r f2be17e6f1ea -r ae2471c4e5c0 src/pt-indir.h --- a/src/pt-indir.h Thu May 15 18:55:47 1997 +0000 +++ b/src/pt-indir.h Thu May 15 19:22:33 1997 +0000 @@ -82,6 +82,8 @@ // The sub-element name. string nm; + + void eval_error (void) const; }; #endif diff -r f2be17e6f1ea -r ae2471c4e5c0 src/pt-plot.cc --- a/src/pt-plot.cc Thu May 15 18:55:47 1997 +0000 +++ b/src/pt-plot.cc Thu May 15 19:22:33 1997 +0000 @@ -58,6 +58,7 @@ #include "oct-obj.h" #include "pt-cmd.h" #include "pt-exp.h" +#include "pt-misc.h" #include "pt-plot.h" #include "pt-walk.h" #include "sighandlers.h" @@ -406,7 +407,8 @@ if (lower) { - octave_value lower_val = lower->eval (); + octave_value lower_val = lower->rvalue (); + if (error_state) { ::error ("evaluating lower bound of plot range"); @@ -423,7 +425,8 @@ if (upper) { - octave_value upper_val = upper->eval (); + octave_value upper_val = upper->rvalue (); + if (error_state) { ::error ("evaluating upper bound of plot range"); @@ -464,7 +467,8 @@ { if (x[i]) { - octave_value tmp = x[i]->eval (); + octave_value tmp = x[i]->rvalue (); + if (error_state) { ::error ("evaluating plot using command"); @@ -561,7 +565,8 @@ if (sp_linetype) { - octave_value tmp = sp_linetype->eval (); + octave_value tmp = sp_linetype->rvalue (); + if (! error_state && tmp.is_defined ()) { double val = tmp.double_value (); @@ -582,7 +587,8 @@ if (sp_pointtype) { - octave_value tmp = sp_pointtype->eval (); + octave_value tmp = sp_pointtype->rvalue (); + if (! error_state && tmp.is_defined ()) { double val = tmp.double_value (); @@ -687,7 +693,7 @@ { if (sp_plot_data) { - octave_value data = sp_plot_data->eval (); + octave_value data = sp_plot_data->rvalue (); if (! error_state && data.is_defined ()) { @@ -779,7 +785,8 @@ if (sp_title_clause) { - octave_value tmp = sp_title_clause->eval (); + octave_value tmp = sp_title_clause->rvalue (); + if (! error_state && tmp.is_string ()) plot_buf << " " << GPLOT_CMD_TITLE << " " << '"' << tmp.string_value () << '"';