26#if defined (HAVE_CONFIG_H)
44 : m_lhs (le), m_rhs (re), m_preserve (plhs), m_ans_assign (), m_etype (t)
66 m_rhs ? m_rhs->
dup (scope) :
nullptr,
85 std::list<octave_lvalue> lvalue_list;
86 lvalue_list.push_back (ult);
88 unwind_action act ([&tw] (
const std::list<octave_lvalue> *lvl)
94 if (ult.
numel () != 1)
100 error (
"value on right hand side of assignment is undefined");
107 error (
"invalid number of elements on RHS of assignment");
112 ult.
assign (m_etype, rhs_val);
136 interp.
feval (
"display", args);
142 std::string msg = ie.message ();
153 : m_lhs (lst), m_rhs (r), m_preserve (plhs)
173 error (
"unexpected call to tree_multi_assignment::dup - please report this bug");
187 unwind_action act ([&tw] (
const std::list<octave_lvalue> *lvl)
195 for (
const auto& lval : lvalue_list)
196 n_out += lval.numel ();
201 && rhs_val1(0).is_cs_list ()
202 ? rhs_val1(0).list_value ()
211 std::list<octave_value_list> retval_list;
213 auto q = m_lhs->begin ();
241 if (lvalue_list.size () == 1 && nel == 0 && n > 0
242 && ! ult.is_black_hole () && ult.index_type () ==
"{"
243 && (ult.index_is_empty ()
244 || (ult.is_defined () && ult.index_is_colon ())))
252 ult.define (
Cell (1, 1));
255 std::list<octave_value_list> idx;
257 ult.set_index (
"{", idx);
261 error (
"some elements undefined in return list");
271 retval_list.push_back (
ovl);
279 if (ult.is_black_hole ())
289 error (
"element number %" OCTAVE_IDX_TYPE_FORMAT
290 " undefined in return list", k+1);
294 retval_list.push_back (tmp);
316 if (! ult.is_black_hole ())
317 error (
"element number %" OCTAVE_IDX_TYPE_FORMAT
318 " undefined in return list", k+1);
341 interp.
feval (
"display", args);
352OCTAVE_END_NAMESPACE(octave)
void set_var(const std::string &var_arg="")
virtual const char * err_id() const =0
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
void assign(octave_value::assign_op, const octave_value &)
octave_idx_type numel() const
octave_value value() const
void stash_name_tags(const string_vector &nm)
octave_value_list slice(octave_idx_type offset, octave_idx_type len, bool tags=false) const
octave_idx_type length() const
octave_value_list list_value() const
bool is_undefined() const
static std::string assign_op_as_string(assign_op)
interpreter & get_interpreter()
const std::list< octave_lvalue > * lvalue_list() const
void set_lvalue_list(const std::list< octave_lvalue > *lst)
std::list< octave_lvalue > make_lvalue_list(tree_argument_list *)
bool statement_printing_enabled()
virtual octave_value evaluate(tree_evaluator &tw, int nargout=1)=0
bool print_result() const
virtual void copy_base(const tree_expression &e)
virtual std::string name() const
virtual tree_expression * dup(symbol_scope &scope) const =0
virtual octave_lvalue lvalue(tree_evaluator &)
virtual octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)=0
octave_value::assign_op op_type() const
tree_expression * dup(symbol_scope &scope) const
tree_multi_assignment(bool plhs=false)
octave_value_list evaluate_n(tree_evaluator &tw, int nargout=1)
~tree_simple_assignment()
octave_value evaluate(tree_evaluator &tw, int nargout=1)
tree_expression * dup(symbol_scope &scope) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void error_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
void err_invalid_structure_assignment()
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.