Mercurial > hg > octave-nkf
comparison src/pt-colon.cc @ 8658:73c4516fae10
New evaluator and debugger derived from tree-walker class
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Feb 2009 00:47:53 -0500 |
parents | d5e08881bba8 |
children | 35cd375d4bb3 |
comparison
equal
deleted
inserted
replaced
8657:102e05821f93 | 8658:73c4516fae10 |
---|---|
74 octave_value_list retval; | 74 octave_value_list retval; |
75 | 75 |
76 if (nargout > 1) | 76 if (nargout > 1) |
77 error ("invalid number of output arguments for colon expression"); | 77 error ("invalid number of output arguments for colon expression"); |
78 else | 78 else |
79 retval = rvalue (); | 79 retval = rvalue1 (nargout); |
80 | 80 |
81 return retval; | 81 return retval; |
82 } | 82 } |
83 | 83 |
84 octave_value | 84 octave_value |
163 | 163 |
164 return retval; | 164 return retval; |
165 } | 165 } |
166 | 166 |
167 octave_value | 167 octave_value |
168 tree_colon_expression::rvalue (void) | 168 tree_colon_expression::rvalue1 (int) |
169 { | 169 { |
170 octave_value retval; | 170 octave_value retval; |
171 | 171 |
172 MAYBE_DO_BREAKPOINT; | |
173 | |
174 if (error_state || ! op_base || ! op_limit) | 172 if (error_state || ! op_base || ! op_limit) |
175 return retval; | 173 return retval; |
176 | 174 |
177 octave_value ov_base = op_base->rvalue (); | 175 octave_value ov_base = op_base->rvalue1 (); |
178 | 176 |
179 if (error_state || ov_base.is_undefined ()) | 177 if (error_state || ov_base.is_undefined ()) |
180 eval_error ("invalid base value in colon expression"); | 178 eval_error ("invalid base value in colon expression"); |
181 else | 179 else |
182 { | 180 { |
183 octave_value ov_limit = op_limit->rvalue (); | 181 octave_value ov_limit = op_limit->rvalue1 (); |
184 | 182 |
185 if (error_state || ov_limit.is_undefined ()) | 183 if (error_state || ov_limit.is_undefined ()) |
186 eval_error ("invalid limit value in colon expression"); | 184 eval_error ("invalid limit value in colon expression"); |
187 else if (ov_base.is_object () || ov_limit.is_object ()) | 185 else if (ov_base.is_object () || ov_limit.is_object ()) |
188 { | 186 { |
189 octave_value_list tmp1; | 187 octave_value_list tmp1; |
190 | 188 |
191 if (op_increment) | 189 if (op_increment) |
192 { | 190 { |
193 octave_value ov_increment = op_increment->rvalue (); | 191 octave_value ov_increment = op_increment->rvalue1 (); |
194 | 192 |
195 if (error_state || ov_increment.is_undefined ()) | 193 if (error_state || ov_increment.is_undefined ()) |
196 eval_error ("invalid increment value in colon expression"); | 194 eval_error ("invalid increment value in colon expression"); |
197 else | 195 else |
198 { | 196 { |
226 { | 224 { |
227 octave_value ov_increment = 1.0; | 225 octave_value ov_increment = 1.0; |
228 | 226 |
229 if (op_increment) | 227 if (op_increment) |
230 { | 228 { |
231 ov_increment = op_increment->rvalue (); | 229 ov_increment = op_increment->rvalue1 (); |
232 | 230 |
233 if (error_state || ov_increment.is_undefined ()) | 231 if (error_state || ov_increment.is_undefined ()) |
234 eval_error ("invalid increment value in colon expression"); | 232 eval_error ("invalid increment value in colon expression"); |
235 } | 233 } |
236 | 234 |