# HG changeset patch # User jwe # Date 956478189 0 # Node ID 1d8d6429396a09b2c46fe312634faece01044278 # Parent 2dc265765850d14f7288d3f1bb7cb2869bc18de3 [project @ 2000-04-23 08:23:08 by jwe] diff -r 2dc265765850 -r 1d8d6429396a src/ChangeLog --- a/src/ChangeLog Thu Apr 20 08:23:47 2000 +0000 +++ b/src/ChangeLog Sun Apr 23 08:23:09 2000 +0000 @@ -1,3 +1,10 @@ +2000-04-23 etienne grossmann + + * pt-mat.cc (tm_row_const::tm_row_const_rep::eval_error): + New args x and y, for dimension mismatch info. + Change callers where appropriate. + (tm_const::init): Report mismatched column dimensions. + 2000-04-11 John W. Eaton * sysdep.cc (kbhit): Also clear cin if at EOF. diff -r 2dc265765850 -r 1d8d6429396a src/pt-mat.cc --- a/src/pt-mat.cc Thu Apr 20 08:23:47 2000 +0000 +++ b/src/pt-mat.cc Sun Apr 23 08:23:09 2000 +0000 @@ -103,7 +103,8 @@ tm_row_const_rep& operator = (const tm_row_const_rep&); - void eval_error (const char *msg, int l, int c) const; + void eval_error (const char *msg, int l, int c, + int x = -1, int y = -1) const; void eval_warning (const char *msg, int l, int c) const; }; @@ -213,7 +214,7 @@ else if (this_elt_nr != nr) { eval_error ("number of rows must match", - elt->line (), elt->column ()); + elt->line (), elt->column (), this_elt_nr, nr); break; } @@ -238,12 +239,22 @@ void tm_row_const::tm_row_const_rep::eval_error (const char *msg, int l, - int c) const + int c, int x, int y) const { if (l == -1 && c == -1) - ::error ("%s", msg); + { + if (x == -1 || y == -1) + ::error ("%s", msg); + else + ::error ("%s (%d != %d)", msg, x, y); + } else - ::error ("%s near line %d, column %d", msg, l, c); + { + if (x == -1 || y == -1) + ::error ("%s near line %d, column %d", msg, l, c); + else + ::error ("%s (%d != %d) near line %d, column %d", msg, x, y, l, c); + } } void @@ -380,7 +391,8 @@ } else if (this_elt_nc != nc) { - ::error ("number of columns must match"); + ::error ("number of columns must match (%d != %d)", + this_elt_nc, nc); break; }