Mercurial > hg > octave-nkf
comparison src/variables.cc @ 4357:d700cfed902a
[project @ 2003-02-22 18:48:18 by jwe]
author | jwe |
---|---|
date | Sat, 22 Feb 2003 18:48:18 +0000 |
parents | 4e23bfdd6172 |
children | dd7af4fa1942 |
comparison
equal
deleted
inserted
replaced
4356:b6ad3db48255 | 4357:d700cfed902a |
---|---|
557 if (! (sr && sr->is_defined ())) | 557 if (! (sr && sr->is_defined ())) |
558 sr = fbi_sym_tab->lookup (symbol_name); | 558 sr = fbi_sym_tab->lookup (symbol_name); |
559 | 559 |
560 if (sr && sr->is_defined ()) | 560 if (sr && sr->is_defined ()) |
561 { | 561 { |
562 bool not_a_struct = struct_elts.empty (); | |
563 bool var_ok = not_a_struct || sr->is_map_element (struct_elts); | |
564 | |
562 if (! retval | 565 if (! retval |
566 && var_ok | |
563 && (type == "any" || type == "var") | 567 && (type == "any" || type == "var") |
564 && sr->is_variable () | 568 && sr->is_user_variable ()) |
565 && (struct_elts.empty () || sr->is_map_element (struct_elts))) | |
566 { | 569 { |
567 retval = 1; | 570 retval = 1; |
568 } | 571 } |
569 | 572 |
570 if (! retval | 573 if (! retval |
571 && (type == "any" || type == "builtin")) | 574 && (type == "any" || type == "builtin")) |
572 { | 575 { |
573 if (sr->is_builtin_function ()) | 576 if (not_a_struct && sr->is_builtin_function ()) |
574 { | 577 { |
575 retval = 5; | 578 retval = 5; |
576 } | 579 } |
577 else if (sr->is_builtin_variable ()) | 580 else if (var_ok && sr->is_builtin_variable ()) |
578 { | 581 { |
579 retval = 101; | 582 retval = 101; |
580 } | 583 } |
581 else if (sr->is_builtin_constant ()) | 584 else if (var_ok && sr->is_builtin_constant ()) |
582 { | 585 { |
583 retval = 102; | 586 retval = 102; |
584 } | 587 } |
585 } | 588 } |
586 | 589 |
587 if (! retval | 590 if (! retval |
591 && not_a_struct | |
588 && (type == "any" || type == "file") | 592 && (type == "any" || type == "file") |
589 && (sr->is_user_function () || sr->is_dld_function ())) | 593 && (sr->is_user_function () || sr->is_dld_function ())) |
590 { | 594 { |
591 octave_value t = sr->def (); | 595 octave_value t = sr->def (); |
592 octave_function *f = t.function_value (true); | 596 octave_function *f = t.function_value (true); |