comparison libinterp/octave-value/ov-classdef.cc @ 16694:50b37deadb66 classdef

Promote scalar object to array for '(' idnex assignment. * libinterp/octave-value/ov-classdef.cc (cdef_object_scalar::subsasgn): Promote scalar object to array for '(' index assignment. Also don't exit octave for unsupported index assignment.
author Michael Goffioul <michael.goffioul@gmail.com>
date Wed, 22 May 2013 15:48:31 -0400
parents b9833510355d
children 2823f8e3da77
comparison
equal deleted inserted replaced
16692:b9833510355d 16694:50b37deadb66
1172 error ("subsasgn: unknown property: %s", name.c_str ()); 1172 error ("subsasgn: unknown property: %s", name.c_str ());
1173 } 1173 }
1174 } 1174 }
1175 break; 1175 break;
1176 1176
1177 case '(':
1178 {
1179 refcount++;
1180
1181 cdef_object this_obj (this);
1182
1183 Array<cdef_object> arr (dim_vector (1, 1), this_obj);
1184
1185 cdef_object new_obj = cdef_object (new cdef_object_array (arr));
1186
1187 new_obj.set_class (get_class ());
1188
1189 octave_value tmp = new_obj.subsasgn (type, idx, rhs);
1190
1191 if (! error_state)
1192 retval = tmp;
1193 }
1194 break;
1195
1177 default: 1196 default:
1178 panic_impossible (); 1197 error ("subsasgn: object cannot be index with `%c'", type[0]);
1179 break; 1198 break;
1180 } 1199 }
1181 1200
1182 return retval; 1201 return retval;
1183 } 1202 }