Mercurial > hg > octave-nkf
changeset 13225:359153d26cc1
eliminate DO_SIMPLE_FOR_LOOP_ONCE macro
* pt-eval.cc (tree_evaluator::visit_simple_for_command):
Eliminate DO_SIMPLE_FOR_LOOP_ONCE macro.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 25 Sep 2011 20:12:19 -0400 |
parents | 931d4b7dc205 |
children | a6becd1b846e |
files | src/pt-eval.cc |
diffstat | 1 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-eval.cc +++ b/src/pt-eval.cc @@ -347,17 +347,24 @@ octave_value val (b + i * increment); - DO_SIMPLE_FOR_LOOP_ONCE (val); + ult.assign (octave_value::op_asn_eq, val); - if (quit) + if (! error_state && loop_body) + loop_body->accept (*this); + + if (quit_loop_now ()) break; } } else if (rhs.is_scalar_type ()) { - bool quit = false; + ult.assign (octave_value::op_asn_eq, rhs); - DO_SIMPLE_FOR_LOOP_ONCE (rhs); + if (! error_state && loop_body) + loop_body->accept (*this); + + // Maybe decrement break and continue states. + quit_loop_now (); } else if (rhs.is_matrix_type () || rhs.is_cell () || rhs.is_string () || rhs.is_map ()) @@ -397,9 +404,13 @@ // do_index_op expects one-based indices. idx(iidx) = i; octave_value val = arg.do_index_op (idx); - DO_SIMPLE_FOR_LOOP_ONCE (val); + + ult.assign (octave_value::op_asn_eq, val); - if (quit) + if (! error_state && loop_body) + loop_body->accept (*this); + + if (quit_loop_now ()) break; } }