Mercurial > hg > octave-lyh
diff src/pt-assign.cc @ 3215:bc3fdfe311a3
[project @ 1998-11-10 14:06:21 by jwe]
author | jwe |
---|---|
date | Tue, 10 Nov 1998 14:12:07 +0000 |
parents | e8a7163701be |
children | 4964d5391acc |
line wrap: on
line diff
--- a/src/pt-assign.cc +++ b/src/pt-assign.cc @@ -104,32 +104,38 @@ { ult.assign (etype, rhs_val); - retval = ult.value (); + if (! error_state) + { + if (etype == octave_value::asn_eq) + retval = rhs_val; + else + retval = ult.value (); - if (error_state) - eval_error (); - else if (print_result ()) - { - if (Vprint_rhs_assign_val) - retval.print_with_name (octave_stdout, - lhs->str_print_code ()); - else + if (print_result ()) { - // We clear any index here so that we can - // get the new value of the referenced - // object below, instead of the indexed - // value (which should be the same as the - // right hand side value). + if (Vprint_rhs_assign_val) + retval.print_with_name (octave_stdout, + lhs->str_print_code ()); + else + { + // We clear any index here so that we can + // get the new value of the referenced + // object below, instead of the indexed + // value (which should be the same as the + // right hand side value). - ult.clear_index (); + ult.clear_index (); - octave_value lhs_val = ult.value (); + octave_value lhs_val = ult.value (); - if (! error_state) - lhs_val.print_with_name (octave_stdout, - lhs->name ()); + if (! error_state) + lhs_val.print_with_name (octave_stdout, + lhs->name ()); + } } } + else + eval_error (); } } } @@ -235,7 +241,13 @@ { ult.assign (etype, rhs_val(k)); - retval(k) = ult.value (); + if (! error_state) + { + if (etype == octave_value::asn_eq) + retval(k) = rhs_val(k); + else + retval(k) = ult.value (); + } } else error ("element number %d undefined in return list",