changeset 4258:b8a4496d7b24

[project @ 2003-01-02 03:45:53 by jwe]
author jwe
date Thu, 02 Jan 2003 03:45:53 +0000
parents e556870ce8f0
children 0493a367de6f
files src/ChangeLog src/pt-arg-list.cc src/pt-arg-list.h
diffstat 3 files changed, 28 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jan 02 03:14:42 2003 +0000
+++ b/src/ChangeLog	Thu Jan 02 03:45:53 2003 +0000
@@ -1,5 +1,12 @@
 2003-01-01  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* 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.
--- a/src/pt-arg-list.cc	Thu Jan 02 03:14:42 2003 +0000
+++ b/src/pt-arg-list.cc	Thu Jan 02 03:45:53 2003 +0000
@@ -57,6 +57,15 @@
     }
 }
 
+void
+tree_argument_list::append (const element_type& s)
+{
+  octave_base_list<tree_expression *>::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)
     {
--- a/src/pt-arg-list.h	Thu Jan 02 03:14:42 2003 +0000
+++ b/src/pt-arg-list.h	Thu Jan 02 03:45:53 2003 +0000
@@ -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&);