comparison libinterp/parse-tree/oct-lvalue.cc @ 28193:56c209ff0a08 stable

improve handling of ans assignment with wrapper functions * oct-lvalue.h, oct-lvalue.cc (octave_lvalue::index_is_colon): New function. * pt-assign.cc (tree_multi_assignment::evaluate_n): Also handle result value when LHS is [varargout{:}] and varargout is defined but empty. * args.tst: New tests.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Apr 2020 14:56:27 -0400
parents bd51beb6205e
children 9a3deb17b4ea
comparison
equal deleted inserted replaced
28191:6ea1e96b69d4 28193:56c209ff0a08
78 } 78 }
79 79
80 return retval; 80 return retval;
81 } 81 }
82 82
83 bool octave_lvalue::index_is_colon (void) const
84 {
85 bool retval = false;
86
87 if (m_idx.size () == 1)
88 {
89 octave_value_list tmp = m_idx.front ();
90
91 retval = (tmp.length () == 1 && tmp(0).is_magic_colon ());
92 }
93
94 return retval;
95 }
96
83 void octave_lvalue::do_unary_op (octave_value::unary_op op) 97 void octave_lvalue::do_unary_op (octave_value::unary_op op)
84 { 98 {
85 if (! is_black_hole ()) 99 if (! is_black_hole ())
86 m_frame.do_non_const_unary_op (op, m_sym, m_type, m_idx); 100 m_frame.do_non_const_unary_op (op, m_sym, m_type, m_idx);
87 } 101 }