Mercurial > hg > octave-lyh
diff src/pt-const.cc @ 191:b6b4d8c513fe
[project @ 1993-10-29 23:41:39 by jwe]
author | jwe |
---|---|
date | Fri, 29 Oct 1993 23:41:39 +0000 |
parents | e2c950dd96d2 |
children | 1761d7a3770c |
line wrap: on
line diff
--- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -393,12 +393,12 @@ int nel = range->nelem (); if (nel < 0) { + delete range; + type_tag = unknown_constant; if (nel == -1) error ("number of elements in range exceeds INT_MAX"); else error ("invalid range"); - - jump_to_top_level (); } else if (nel > 1) type_tag = range_constant; @@ -582,14 +582,11 @@ else { if (i > nr) - message ((char *) NULL, - "row index = %d exceeds max row dimension = %d", i, nr); + error ("row index = %d exceeds max row dimension = %d", i, nr); + if (j > nc) - message ((char *) NULL, - "column index = %d exceeds max column dimension = %d", - j, nc); - - jump_to_top_level (); + error ("column index = %d exceeds max column dimension = %d", + j, nc); } } } @@ -618,33 +615,21 @@ resize (1, i, 0.0); } else - { - message ((char *) NULL, - "matrix index = %d exceeds max dimension = %d", i, nc); - jump_to_top_level (); - } + error ("matrix index = %d exceeds max dimension = %d", i, nc); } else if (nr == 1 && i > nc) { if (user_pref.resize_on_range_error) resize (1, i, 0.0); else - { - message ((char *) NULL, - "matrix index = %d exceeds max dimension = %d", i, nc); - jump_to_top_level (); - } + error ("matrix index = %d exceeds max dimension = %d", i, nc); } else if (nc == 1 && i > nr) { if (user_pref.resize_on_range_error) resize (i, 1, 0.0); else - { - message ((char *) NULL, - "matrix index = %d exceeds max dimension = ", i, nc); - jump_to_top_level (); - } + error ("matrix index = %d exceeds max dimension = ", i, nc); } } @@ -2320,15 +2305,6 @@ return retval; } -void -tree_constant_rep::print_if_string (ostream& os, int warn) -{ - if (type_tag == string_constant) - os << string << "\n"; - else if (warn) - warning ("expecting string, found numeric constant"); -} - tree_constant tree_constant_rep::mapper (Mapper_fcn& m_fcn, int print) const {