Mercurial > octave-nkf
annotate src/pt-idx.cc @ 8011:3100283874d7
improve backtrace error messages
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 05 Aug 2008 23:09:32 -0400 |
parents | 975e9540be2c |
children | 3d8a914c580e |
rev | line source |
---|---|
2980 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006, |
4 2007 John W. Eaton | |
2980 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2980 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2980 | 21 |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 #include <config.h> | |
26 #endif | |
27 | |
3933 | 28 #include "Cell.h" |
2980 | 29 #include "error.h" |
3930 | 30 #include "oct-map.h" |
2980 | 31 #include "oct-obj.h" |
32 #include "oct-lvalue.h" | |
33 #include "ov.h" | |
3930 | 34 #include "pager.h" |
2982 | 35 #include "pt-arg-list.h" |
3930 | 36 #include "pt-bp.h" |
7336 | 37 #include "pt-id.h" |
2980 | 38 #include "pt-idx.h" |
39 #include "pt-walk.h" | |
3930 | 40 #include "utils.h" |
41 #include "variables.h" | |
2980 | 42 |
43 // Index expressions. | |
44 | |
5861 | 45 tree_index_expression::tree_index_expression (int l, int c) |
7791
975e9540be2c
pt-idx.cc: initialize fields in constructors
John W. Eaton <jwe@octave.org>
parents:
7790
diff
changeset
|
46 : tree_expression (l, c), expr (0), args (0), type (), |
5861 | 47 arg_nm (), dyn_field () { } |
48 | |
3546 | 49 tree_index_expression::tree_index_expression (tree_expression *e, |
50 tree_argument_list *lst, | |
3933 | 51 int l, int c, char t) |
7791
975e9540be2c
pt-idx.cc: initialize fields in constructors
John W. Eaton <jwe@octave.org>
parents:
7790
diff
changeset
|
52 : tree_expression (l, c), expr (e), args (0), type (), |
4131 | 53 arg_nm (), dyn_field () |
3933 | 54 { |
55 append (lst, t); | |
56 } | |
3215 | 57 |
3930 | 58 tree_index_expression::tree_index_expression (tree_expression *e, |
59 const std::string& n, | |
3944 | 60 int l, int c) |
7791
975e9540be2c
pt-idx.cc: initialize fields in constructors
John W. Eaton <jwe@octave.org>
parents:
7790
diff
changeset
|
61 : tree_expression (l, c), expr (e), args (0), type (), |
4131 | 62 arg_nm (), dyn_field () |
3933 | 63 { |
64 append (n); | |
65 } | |
66 | |
4131 | 67 tree_index_expression::tree_index_expression (tree_expression *e, |
68 tree_expression *df, | |
69 int l, int c) | |
7791
975e9540be2c
pt-idx.cc: initialize fields in constructors
John W. Eaton <jwe@octave.org>
parents:
7790
diff
changeset
|
70 : tree_expression (l, c), expr (e), args (0), type (), |
4131 | 71 arg_nm (), dyn_field () |
72 { | |
73 append (df); | |
74 } | |
75 | |
3933 | 76 void |
77 tree_index_expression::append (tree_argument_list *lst, char t) | |
78 { | |
4219 | 79 args.push_back (lst); |
3933 | 80 type.append (1, t); |
4219 | 81 arg_nm.push_back (lst ? lst->get_arg_names () : string_vector ()); |
82 dyn_field.push_back (static_cast<tree_expression *> (0)); | |
3933 | 83 } |
84 | |
85 void | |
86 tree_index_expression::append (const std::string& n) | |
87 { | |
4219 | 88 args.push_back (static_cast<tree_argument_list *> (0)); |
3933 | 89 type.append ("."); |
4219 | 90 arg_nm.push_back (n); |
91 dyn_field.push_back (static_cast<tree_expression *> (0)); | |
4131 | 92 } |
93 | |
94 void | |
95 tree_index_expression::append (tree_expression *df) | |
96 { | |
4219 | 97 args.push_back (static_cast<tree_argument_list *> (0)); |
4131 | 98 type.append ("."); |
4219 | 99 arg_nm.push_back (""); |
100 dyn_field.push_back (df); | |
3933 | 101 } |
3930 | 102 |
2980 | 103 tree_index_expression::~tree_index_expression (void) |
104 { | |
105 delete expr; | |
3933 | 106 |
107 while (! args.empty ()) | |
108 { | |
4219 | 109 std::list<tree_argument_list *>::iterator p = args.begin (); |
110 delete *p; | |
111 args.erase (p); | |
3933 | 112 } |
2980 | 113 } |
114 | |
5099 | 115 bool |
116 tree_index_expression::has_magic_end (void) const | |
117 { | |
118 for (std::list<tree_argument_list *>::const_iterator p = args.begin (); | |
119 p != args.end (); | |
120 p++) | |
121 { | |
122 tree_argument_list *elt = *p; | |
123 | |
124 if (elt && elt->has_magic_end ()) | |
125 return true; | |
126 } | |
127 | |
128 return false; | |
129 } | |
130 | |
2991 | 131 // This is useful for printing the name of the variable in an indexed |
132 // assignment. | |
133 | |
3536 | 134 std::string |
2991 | 135 tree_index_expression::name (void) const |
136 { | |
4131 | 137 return expr->name (); |
3933 | 138 } |
139 | |
140 static Cell | |
141 make_subs_cell (tree_argument_list *args, const string_vector& arg_nm) | |
142 { | |
143 Cell retval; | |
144 | |
145 octave_value_list arg_values; | |
146 | |
147 if (args) | |
148 arg_values = args->convert_to_const_vector (); | |
149 | |
150 if (! error_state) | |
151 { | |
152 int n = arg_values.length (); | |
153 | |
154 if (n > 0) | |
155 { | |
156 arg_values.stash_name_tags (arg_nm); | |
157 | |
4548 | 158 retval.resize (dim_vector (1, n)); |
3933 | 159 |
160 for (int i = 0; i < n; i++) | |
161 retval(0,i) = arg_values(i); | |
162 } | |
163 } | |
164 | |
165 return retval; | |
166 } | |
167 | |
168 static inline octave_value_list | |
4234 | 169 make_value_list (tree_argument_list *args, const string_vector& arg_nm, |
170 const octave_value *object) | |
3933 | 171 { |
172 octave_value_list retval; | |
173 | |
174 if (args) | |
4234 | 175 retval = args->convert_to_const_vector (object); |
3933 | 176 |
177 if (! error_state) | |
178 { | |
179 int n = retval.length (); | |
180 | |
181 if (n > 0) | |
182 retval.stash_name_tags (arg_nm); | |
183 } | |
184 | |
185 return retval; | |
186 } | |
187 | |
4131 | 188 std::string |
4219 | 189 tree_index_expression::get_struct_index |
190 (std::list<string_vector>::const_iterator p_arg_nm, | |
191 std::list<tree_expression *>::const_iterator p_dyn_field) const | |
4131 | 192 { |
4219 | 193 std::string fn = (*p_arg_nm)(0); |
4131 | 194 |
195 if (fn.empty ()) | |
196 { | |
4219 | 197 tree_expression *df = *p_dyn_field; |
4131 | 198 |
199 if (df) | |
200 { | |
201 octave_value t = df->rvalue (); | |
202 | |
203 if (! error_state) | |
4143 | 204 { |
205 fn = t.string_value (); | |
206 | |
207 if (! valid_identifier (fn)) | |
6811 | 208 ::error ("invalid structure field name `%s'", fn.c_str ()); |
4143 | 209 } |
4131 | 210 } |
211 else | |
212 panic_impossible (); | |
213 } | |
214 | |
215 return fn; | |
216 } | |
217 | |
3933 | 218 Octave_map |
219 tree_index_expression::make_arg_struct (void) const | |
220 { | |
4219 | 221 int n = args.size (); |
3933 | 222 |
7336 | 223 Cell type_field (n, 1); |
224 Cell subs_field (n, 1); | |
3933 | 225 |
4219 | 226 std::list<tree_argument_list *>::const_iterator p_args = args.begin (); |
227 std::list<string_vector>::const_iterator p_arg_nm = arg_nm.begin (); | |
228 std::list<tree_expression *>::const_iterator p_dyn_field = dyn_field.begin (); | |
3933 | 229 |
230 Octave_map m; | |
231 | |
232 for (int i = 0; i < n; i++) | |
233 { | |
234 switch (type[i]) | |
235 { | |
236 case '(': | |
7336 | 237 subs_field(i) = make_subs_cell (*p_args, *p_arg_nm); |
3933 | 238 break; |
239 | |
240 case '{': | |
7336 | 241 subs_field(i) = make_subs_cell (*p_args, *p_arg_nm); |
3933 | 242 break; |
243 | |
244 case '.': | |
8011
3100283874d7
improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents:
7791
diff
changeset
|
245 subs_field(i) = get_struct_index (p_arg_nm, p_dyn_field); |
3933 | 246 break; |
247 | |
248 default: | |
249 panic_impossible (); | |
250 } | |
251 | |
252 if (error_state) | |
253 return m; | |
254 | |
4219 | 255 p_args++; |
256 p_arg_nm++; | |
257 p_dyn_field++; | |
3933 | 258 } |
259 | |
7336 | 260 m.assign ("type", type_field); |
261 m.assign ("subs", subs_field); | |
3933 | 262 |
263 return m; | |
2991 | 264 } |
265 | |
2980 | 266 octave_value_list |
267 tree_index_expression::rvalue (int nargout) | |
268 { | |
269 octave_value_list retval; | |
270 | |
271 if (error_state) | |
272 return retval; | |
273 | |
7336 | 274 octave_value first_expr_val; |
275 | |
276 octave_value_list first_args; | |
277 | |
278 bool have_args = false; | |
279 | |
280 if (expr->is_identifier () && type[0] == '(') | |
281 { | |
282 tree_identifier *id = dynamic_cast<tree_identifier *> (expr); | |
283 | |
284 if (! (id->is_variable () || args.empty ())) | |
285 { | |
286 tree_argument_list *al = *(args.begin ()); | |
287 | |
288 size_t n = al ? al->length () : 0; | |
289 | |
290 if (n > 0) | |
291 { | |
292 string_vector anm = *(arg_nm.begin ()); | |
293 | |
294 first_expr_val = id->do_lookup (al, anm, first_args, have_args); | |
295 } | |
296 } | |
297 } | |
2980 | 298 |
299 if (! error_state) | |
300 { | |
7336 | 301 if (first_expr_val.is_undefined ()) |
302 first_expr_val = expr->rvalue (); | |
303 | |
304 octave_value tmp = first_expr_val; | |
305 | |
4219 | 306 std::list<octave_value_list> idx; |
3930 | 307 |
4219 | 308 int n = args.size (); |
3933 | 309 |
4219 | 310 std::list<tree_argument_list *>::iterator p_args = args.begin (); |
311 std::list<string_vector>::iterator p_arg_nm = arg_nm.begin (); | |
312 std::list<tree_expression *>::iterator p_dyn_field = dyn_field.begin (); | |
3930 | 313 |
3933 | 314 for (int i = 0; i < n; i++) |
315 { | |
4432 | 316 if (i > 0) |
317 { | |
318 tree_argument_list *al = *p_args; | |
319 | |
320 if (al && al->has_magic_end ()) | |
321 { | |
322 // We have an expression like | |
323 // | |
324 // x{end}.a(end) | |
325 // | |
326 // and we are looking at the argument list that | |
327 // contains the second (or third, etc.) "end" token, | |
328 // so we must evaluate everything up to the point of | |
7336 | 329 // that argument list so we can pass the appropriate |
4432 | 330 // value to the built-in __end__ function. |
331 | |
332 octave_value_list tmp_list | |
7336 | 333 = first_expr_val.subsref (type.substr (0, i), idx, nargout); |
4432 | 334 |
335 tmp = tmp_list(0); | |
336 | |
337 if (error_state) | |
338 break; | |
339 } | |
340 } | |
341 | |
3933 | 342 switch (type[i]) |
343 { | |
344 case '(': | |
7336 | 345 if (have_args) |
346 { | |
347 idx.push_back (first_args); | |
348 have_args = false; | |
349 } | |
350 else | |
351 idx.push_back (make_value_list (*p_args, *p_arg_nm, &tmp)); | |
3933 | 352 break; |
3930 | 353 |
3933 | 354 case '{': |
4234 | 355 idx.push_back (make_value_list (*p_args, *p_arg_nm, &tmp)); |
3933 | 356 break; |
2980 | 357 |
3933 | 358 case '.': |
8011
3100283874d7
improve backtrace error messages
John W. Eaton <jwe@octave.org>
parents:
7791
diff
changeset
|
359 idx.push_back (octave_value (get_struct_index (p_arg_nm, p_dyn_field))); |
3933 | 360 break; |
3930 | 361 |
3933 | 362 default: |
363 panic_impossible (); | |
364 } | |
3930 | 365 |
3933 | 366 if (error_state) |
367 break; | |
368 | |
4219 | 369 p_args++; |
370 p_arg_nm++; | |
371 p_dyn_field++; | |
2980 | 372 } |
3933 | 373 |
374 if (! error_state) | |
4432 | 375 retval = first_expr_val.subsref (type, idx, nargout); |
2980 | 376 } |
377 | |
378 return retval; | |
379 } | |
380 | |
381 octave_value | |
382 tree_index_expression::rvalue (void) | |
383 { | |
384 octave_value retval; | |
385 | |
386 octave_value_list tmp = rvalue (1); | |
387 | |
388 if (! tmp.empty ()) | |
389 retval = tmp(0); | |
390 | |
391 return retval; | |
392 } | |
393 | |
394 octave_lvalue | |
395 tree_index_expression::lvalue (void) | |
396 { | |
397 octave_lvalue retval; | |
398 | |
4219 | 399 std::list<octave_value_list> idx; |
3933 | 400 |
4219 | 401 int n = args.size (); |
3933 | 402 |
4219 | 403 std::list<tree_argument_list *>::iterator p_args = args.begin (); |
404 std::list<string_vector>::iterator p_arg_nm = arg_nm.begin (); | |
405 std::list<tree_expression *>::iterator p_dyn_field = dyn_field.begin (); | |
3933 | 406 |
4234 | 407 retval = expr->lvalue (); |
3933 | 408 |
2980 | 409 if (! error_state) |
410 { | |
7099 | 411 bool have_new_struct_field = false; |
412 | |
413 octave_idx_type new_struct_field_nel = 0; | |
414 | |
4432 | 415 // I think it is OK to have a copy here. |
416 | |
417 const octave_value *tro = retval.object (); | |
418 | |
419 octave_value first_retval_object; | |
420 | |
421 if (tro) | |
422 first_retval_object = *tro; | |
423 | |
424 octave_value tmp = first_retval_object; | |
4234 | 425 |
426 for (int i = 0; i < n; i++) | |
427 { | |
4432 | 428 if (i > 0) |
429 { | |
430 tree_argument_list *al = *p_args; | |
431 | |
432 if (al && al->has_magic_end ()) | |
433 { | |
434 // We have an expression like | |
435 // | |
436 // x{end}.a(end) | |
437 // | |
438 // and we are looking at the argument list that | |
439 // contains the second (or third, etc.) "end" token, | |
440 // so we must evaluate everything up to the point of | |
7336 | 441 // that argument list so we pass the appropriate |
4432 | 442 // value to the built-in __end__ function. |
443 | |
444 octave_value_list tmp_list | |
7336 | 445 = first_retval_object.subsref (type.substr (0, i), idx, 1); |
4432 | 446 |
447 tmp = tmp_list(0); | |
448 | |
449 if (error_state) | |
450 break; | |
451 } | |
452 } | |
453 | |
4234 | 454 switch (type[i]) |
455 { | |
456 case '(': | |
4432 | 457 idx.push_back (make_value_list (*p_args, *p_arg_nm, &tmp)); |
4234 | 458 break; |
459 | |
460 case '{': | |
5846 | 461 { |
462 octave_value_list tidx | |
463 = make_value_list (*p_args, *p_arg_nm, &tmp); | |
464 | |
465 idx.push_back (tidx); | |
466 | |
467 if (i == n-1) | |
468 { | |
469 // Last indexing element. Will this result in a | |
470 // comma-separated list? | |
471 | |
472 if (tidx.has_magic_colon ()) | |
473 { | |
474 octave_value_list tmp_list | |
475 = first_retval_object.subsref (type, idx, 1); | |
476 | |
477 if (! error_state) | |
478 { | |
479 octave_value val = tmp_list(0); | |
480 | |
481 if (val.is_cs_list ()) | |
482 retval.numel (val.numel ()); | |
483 } | |
484 } | |
485 else | |
486 { | |
487 octave_idx_type nel = 1; | |
488 | |
489 octave_idx_type nidx = tidx.length (); | |
490 | |
491 for (octave_idx_type j = 0; j < nidx; j++) | |
492 { | |
493 octave_value val = tidx(j); | |
494 | |
495 nel *= val.numel (); | |
496 } | |
497 | |
498 retval.numel (nel); | |
499 } | |
500 } | |
501 } | |
4234 | 502 break; |
503 | |
504 case '.': | |
505 { | |
6833 | 506 octave_value tidx = get_struct_index (p_arg_nm, p_dyn_field); |
507 | |
508 if (! error_state) | |
509 { | |
510 if (i == n-1) | |
511 { | |
512 // Last indexing element. Will this result in a | |
513 // comma-separated list? | |
514 | |
7099 | 515 if (have_new_struct_field) |
516 retval.numel (new_struct_field_nel); | |
517 else if (i > 0) | |
7057 | 518 { |
7099 | 519 std::string ttype = type.substr (0, i); |
520 | |
7100 | 521 char c = ttype[ttype.length()-1]; |
522 if (c == '(' || c == '{') | |
7057 | 523 { |
7099 | 524 octave_idx_type nel = 1; |
525 | |
7057 | 526 octave_value_list xidx = idx.back (); |
527 | |
7099 | 528 octave_idx_type nidx = xidx.length (); |
529 | |
530 for (octave_idx_type j = 0; j < nidx; j++) | |
531 { | |
532 octave_value val = xidx(j); | |
533 | |
534 nel *= val.numel (); | |
535 } | |
536 | |
537 retval.numel (nel); | |
538 } | |
7200 | 539 else if (first_retval_object.is_defined () |
540 && ! (first_retval_object.is_real_matrix () | |
541 && first_retval_object.is_zero_by_zero ())) | |
7099 | 542 { |
543 octave_value_list tmp_list | |
544 = first_retval_object.subsref (ttype, idx, 1); | |
545 | |
546 if (! error_state) | |
7057 | 547 { |
7099 | 548 octave_value val = tmp_list(0); |
7057 | 549 |
7099 | 550 retval.numel (val.numel ()); |
551 } | |
552 } | |
553 else | |
554 retval.numel (1); | |
555 } | |
556 else | |
557 { | |
7200 | 558 if (first_retval_object.is_defined () |
559 && ! (first_retval_object.is_real_matrix () | |
560 && first_retval_object.is_zero_by_zero ())) | |
7099 | 561 retval.numel (first_retval_object.numel ()); |
562 else | |
563 retval.numel (1); | |
564 } | |
565 } | |
566 else | |
567 { | |
568 octave_value tobj = first_retval_object; | |
569 | |
570 if (! have_new_struct_field) | |
571 { | |
7200 | 572 if (i > 0 && first_retval_object.is_defined () |
573 && ! (first_retval_object.is_real_matrix () | |
574 && first_retval_object.is_zero_by_zero ())) | |
7099 | 575 { |
576 std::string ttype = type.substr (0, i); | |
577 | |
7100 | 578 char c = ttype[ttype.length()-1]; |
579 | |
580 if (! (c == '(' || c == '{')) | |
7099 | 581 { |
7057 | 582 octave_value_list tmp_list |
583 = first_retval_object.subsref (ttype, idx, 1); | |
584 | |
585 if (! error_state) | |
7099 | 586 tobj = tmp_list(0); |
587 } | |
588 } | |
589 | |
590 if (! error_state && tobj.is_map ()) | |
591 { | |
592 if (tidx.is_string ()) | |
593 { | |
594 Octave_map m = tobj.map_value (); | |
595 | |
596 std::string s = tidx.string_value (); | |
597 | |
598 if (! m.contains (s)) | |
7057 | 599 { |
7099 | 600 have_new_struct_field = true; |
7057 | 601 |
7099 | 602 new_struct_field_nel = m.numel (); |
7057 | 603 } |
604 } | |
605 } | |
606 } | |
6833 | 607 } |
7057 | 608 |
609 idx.push_back (octave_value (tidx)); | |
6833 | 610 } |
4234 | 611 } |
612 break; | |
613 | |
614 default: | |
615 panic_impossible (); | |
616 } | |
617 | |
618 if (error_state) | |
619 break; | |
620 | |
621 p_args++; | |
622 p_arg_nm++; | |
623 p_dyn_field++; | |
624 } | |
3930 | 625 |
3933 | 626 if (! error_state) |
627 retval.set_index (type, idx); | |
2980 | 628 } |
629 | |
630 return retval; | |
631 } | |
632 | |
7099 | 633 /* |
634 %!test | |
635 %! x = {1, 2, 3}; | |
636 %! [x{:}] = deal (4, 5, 6); | |
637 %! assert (x, {4, 5, 6}); | |
638 | |
639 %!test | |
640 %! [x.a, x.b.c] = deal (1, 2); | |
641 %! assert (x.a == 1 && x.b.c == 2); | |
642 | |
643 %!test | |
644 %! [x.a, x(2).b] = deal (1, 2); | |
645 %! assert (x(1).a == 1 && isempty (x(2).a) && isempty (x(1).b) && x(2).b == 2); | |
646 | |
647 %!test | |
648 %! x = struct (zeros (0, 1), {"a", "b"}); | |
649 %! x(2).b = 1; | |
650 %! assert (x(2).b == 1); | |
651 | |
652 %!test | |
653 %! x = struct (zeros (0, 1), {"a", "b"}); | |
654 %! x(2).b = 1; | |
655 %! assert (x(2).b == 1); | |
656 */ | |
657 | |
5861 | 658 tree_index_expression * |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
659 tree_index_expression::dup (symbol_table::scope_id scope, |
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
660 symbol_table::context_id context) |
5861 | 661 { |
662 tree_index_expression *new_idx_expr | |
663 = new tree_index_expression (line (), column ()); | |
664 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
665 new_idx_expr->expr = expr ? expr->dup (scope, context) : 0; |
5861 | 666 |
667 std::list<tree_argument_list *> new_args; | |
668 | |
669 for (std::list<tree_argument_list *>::iterator p = args.begin (); | |
670 p != args.end (); | |
671 p++) | |
672 { | |
673 tree_argument_list *elt = *p; | |
674 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
675 new_args.push_back (elt ? elt->dup (scope, context) : 0); |
5861 | 676 } |
677 | |
678 new_idx_expr->args = new_args; | |
679 | |
680 new_idx_expr->type = type; | |
681 | |
682 new_idx_expr->arg_nm = arg_nm; | |
683 | |
684 std::list<tree_expression *> new_dyn_field; | |
685 | |
686 for (std::list<tree_expression *>::iterator p = dyn_field.begin (); | |
687 p != dyn_field.end (); | |
688 p++) | |
689 { | |
690 tree_expression *elt = *p; | |
691 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
692 new_dyn_field.push_back (elt ? elt->dup (scope, context) : 0); |
5861 | 693 } |
694 | |
695 new_idx_expr->dyn_field = new_dyn_field; | |
696 | |
697 new_idx_expr->copy_base (*this); | |
698 | |
699 return new_idx_expr; | |
700 } | |
701 | |
2980 | 702 void |
703 tree_index_expression::accept (tree_walker& tw) | |
704 { | |
705 tw.visit_index_expression (*this); | |
706 } | |
707 | |
708 /* | |
709 ;;; Local Variables: *** | |
710 ;;; mode: C++ *** | |
711 ;;; End: *** | |
712 */ |