diff src/ov-range.cc @ 3933:f9ea3dcf58ee

[project @ 2002-05-15 03:21:00 by jwe]
author jwe
date Wed, 15 May 2002 03:21:01 +0000
parents b80bbb43a1a9
children 0eb247b9cc9b
line wrap: on
line diff
--- a/src/ov-range.cc	Tue May 07 18:10:44 2002 +0000
+++ b/src/ov-range.cc	Wed May 15 03:21:01 2002 +0000
@@ -35,6 +35,7 @@
 
 #include "gripes.h"
 #include "ops.h"
+#include "oct-obj.h"
 #include "ov-range.h"
 #include "ov-re-mat.h"
 #include "ov-scalar.h"
@@ -81,7 +82,34 @@
 }
 
 octave_value
-octave_range::do_index_op (const octave_value_list& idx)
+octave_range::subsref (const std::string type,
+		       const SLList<octave_value_list>& idx)
+{
+  octave_value retval;
+
+  switch (type[0])
+    {
+    case '(':
+      retval = do_index_op (idx.front ());
+      break;
+
+    case '{':
+    case '.':
+      {
+	std::string nm = type_name ();
+	error ("%s cannot be indexed with %c", nm.c_str (), type[0]);
+      }
+      break;
+
+    default:
+      panic_impossible ();
+    }
+
+  return retval.next_subsref (type, idx);
+}
+
+octave_value
+octave_range::do_index_op (const octave_value_list& idx, int resize_ok)
 {
   // XXX FIXME XXX -- this doesn't solve the problem of
   //
@@ -95,7 +123,7 @@
 
   octave_value tmp (new octave_matrix (range.matrix_value ()));
 
-  return tmp.do_index_op (idx);
+  return tmp.do_index_op (idx, resize_ok);
 }
 
 double