Mercurial > hg > octave-shane
changeset 5358:cae8081f90f2
[project @ 2005-05-19 23:22:06 by jwe]
author | jwe |
---|---|
date | Thu, 19 May 2005 23:22:06 +0000 |
parents | 21143f1609f2 |
children | 17e40a1331b0 |
files | src/ChangeLog src/pt-colon.cc |
diffstat | 2 files changed, 9 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2005-05-18 John W. Eaton <jwe@octave.org> + * pt-colon.cc (tree_colon_expression::make_range): Don't require + scalars values as range components. + * version.h (OCTAVE_VERSION): Now 2.9.3 (OCTAVE_API_VERSION): Now api-v16.
--- a/src/pt-colon.cc +++ b/src/pt-colon.cc @@ -93,22 +93,15 @@ bool limit_empty = m_limit.is_empty (); bool increment_empty = m_increment.is_empty (); - if ((base_empty || m_base.numel () == 1) - && (limit_empty || m_limit.numel () == 1) - && (increment_empty || m_increment.numel () == 1)) + if (base_empty || limit_empty || increment_empty) + retval = Range (); + else { - if (base_empty || limit_empty || increment_empty) - retval = Range (); - else - { - retval = Range (m_base(0), m_limit(0), m_increment(0)); + retval = Range (m_base(0), m_limit(0), m_increment(0)); - if (result_is_str) - retval = retval.convert_to_str (false, true, dq_str ? '"' : '\''); - } + if (result_is_str) + retval = retval.convert_to_str (false, true, dq_str ? '"' : '\''); } - else - eval_error ("colon expression values must be scalars or empty matrices"); return retval; }