diff src/pt-arg-list.cc @ 4267:7cd865a8c815

[project @ 2003-01-03 15:27:05 by jwe]
author jwe
date Fri, 03 Jan 2003 15:27:06 +0000
parents 48897c78c52b
children ff7187bd3075
line wrap: on
line diff
--- a/src/pt-arg-list.cc	Fri Jan 03 06:22:55 2003 +0000
+++ b/src/pt-arg-list.cc	Fri Jan 03 15:27:06 2003 +0000
@@ -57,19 +57,27 @@
     }
 }
 
+bool
+tree_argument_list::has_magic_end (void) const
+{
+  for (const_iterator p = begin (); p != end (); p++)
+    {
+      tree_expression *elt = *p;
+
+      if (elt && elt->has_magic_end ())
+	return true;
+    }
+
+  return false;
+}
+
 void
 tree_argument_list::append (const element_type& s)
 {
   octave_base_list<tree_expression *>::append (s);
 
-  // XXX FIXME XXX -- wait, it's not that simple!  The argument list
-  // may include expressions, so we will have to do some more work
-  // here.  We need a new function for all expression types that can
-  // tell us whether the expression includes the magic end token!
-
-  //  if (s && s->is_identifier () && s->name () == "__end__")
-
-  list_includes_magic_end = true;
+  if (! list_includes_magic_end && s && s->has_magic_end ())
+    list_includes_magic_end = true;
 }
 
 int