diff src/pt-mat.cc @ 2419:015cbef2b75f

[project @ 1996-10-16 17:46:12 by jwe]
author jwe
date Wed, 16 Oct 1996 17:46:12 +0000
parents dd29ab8af9e7
children 29cd3862a9dc
line wrap: on
line diff
--- a/src/pt-mat.cc	Wed Oct 16 17:02:30 1996 +0000
+++ b/src/pt-mat.cc	Wed Oct 16 17:46:12 1996 +0000
@@ -98,6 +98,11 @@
 
     tm_row_const_rep& operator =
       (const tm_row_const_rep&);
+
+
+    void eval_error (const char *msg, int l, int c) const;
+
+    void eval_warning (const char *msg, int l, int c) const;
   };
 
 public:
@@ -182,10 +187,12 @@
 	  if (this_elt_nr == 0 || this_elt_nc == 0)
 	    {
 	      if (Vempty_list_elements_ok < 0)
-		warning ("empty matrix found in matrix list");
+		eval_warning ("empty matrix found in matrix list",
+			      elt->line (), elt->column ());
 	      else if (Vempty_list_elements_ok == 0)
 		{
-		  ::error ("empty matrix found in matrix list");
+		  eval_error ("empty matrix found in matrix list",
+			      elt->line (), elt->column ());
 		  break;
 		}
 	    }
@@ -199,7 +206,8 @@
 		}
 	      else if (this_elt_nr != nr)
 		{
-		  ::error ("number of rows must match");
+		  eval_error ("number of rows must match",
+			      elt->line (), elt->column ());
 		  break;
 		}
 
@@ -219,6 +227,26 @@
   ok = ! error_state;
 }
 
+void
+tm_row_const::tm_row_const_rep::eval_error (const char *msg, int l,
+					    int c) const
+{
+  if (l == -1 && c == -1)
+    ::error ("%s", msg);
+  else
+    ::error ("%s near line %d, column %d", msg, l, c);
+}
+
+void
+tm_row_const::tm_row_const_rep::eval_warning (const char *msg, int l,
+					      int c) const
+{
+  if (l == -1 && c == -1)
+    ::warning ("%s", msg);
+  else
+    ::warning ("%s near line %d, column %d", msg, l, c);
+}
+
 template class SLNode<tm_row_const>;
 template class SLList<tm_row_const>;