# HG changeset patch # User jwe # Date 1041479153 0 # Node ID b8a4496d7b24ff072e4cc4597129c3ebef80a947 # Parent e556870ce8f018ccc0b5b5e497dbfcb3d173d11b [project @ 2003-01-02 03:45:53 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2003-01-01 John W. Eaton + * pt-arg-list.cc (tree_argument_list::append): New function. + (tree_argument_list::convert_to_const_vector): Don't save and + set pointer to indexed object if list_includes_magic_end is false. + * pt-arg-list.h (tree_argument_list::append): Provide decl. + (tree_argument_list::list_includes_magic_end): New data member. + (tree_argument_list::tree_argument_list): Initialize it. + * ov-base.cc (octave_base_value::char_matrix_value, octave_base_value::all_strings, octave_base_value::string_value): Attempt conversions here if Vimplicit_num_to_num_ok is true. diff --git a/src/pt-arg-list.cc b/src/pt-arg-list.cc --- a/src/pt-arg-list.cc +++ b/src/pt-arg-list.cc @@ -57,6 +57,15 @@ } } +void +tree_argument_list::append (const element_type& s) +{ + octave_base_list::append (s); + + if (s && s->is_identifier () && s->name () == "__end__") + list_includes_magic_end = true; +} + int tree_argument_list::nargout_count (void) const { @@ -154,7 +163,8 @@ // END doesn't make sense for functions. Maybe we need a different // way of asking an octave_value object this question? - bool stash_object = (object && object->is_constant ()); + bool stash_object = (list_includes_magic_end + && object && object->is_constant ()); if (stash_object) { diff --git a/src/pt-arg-list.h b/src/pt-arg-list.h --- a/src/pt-arg-list.h +++ b/src/pt-arg-list.h @@ -45,9 +45,13 @@ { public: - tree_argument_list (void) { } + typedef tree_expression* element_type; - tree_argument_list (tree_expression *t) { append (t); } + tree_argument_list (void) + : list_includes_magic_end (false) { } + + tree_argument_list (tree_expression *t) + : list_includes_magic_end (false) { append (t); } ~tree_argument_list (void); @@ -59,6 +63,8 @@ return retval; } + void append (const element_type& s); + int nargout_count (void) const; bool all_elements_are_constant (void) const; @@ -71,6 +77,8 @@ private: + bool list_includes_magic_end; + // No copying! tree_argument_list (const tree_argument_list&);