Mercurial > hg > octave-lyh
diff src/ov-base.cc @ 4139:02ca908056e9
[project @ 2002-11-01 00:49:13 by jwe]
author | jwe |
---|---|
date | Fri, 01 Nov 2002 00:49:13 +0000 |
parents | cbac6756967e |
children | 5719210fff4c |
line wrap: on
line diff
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -103,8 +103,40 @@ if (is_defined ()) { - std::string nm = type_name (); - error ("can't perform indexed assignment for %s type", nm.c_str ()); + if (is_numeric_type ()) + { + switch (type[0]) + { + case '(': + { + if (type.length () == 1) + retval = numeric_assign (type, idx, rhs); + else + { + std::string nm = type_name (); + error ("in indexed assignment of %s, last rhs index must be ()", + nm.c_str ()); + } + } + break; + + case '{': + case '.': + { + std::string nm = type_name (); + error ("%s cannot be indexed with %c", nm.c_str (), type[0]); + } + break; + + default: + panic_impossible (); + } + } + else + { + std::string nm = type_name (); + error ("can't perform indexed assignment for %s type", nm.c_str ()); + } } else {