diff src/pt-const.cc @ 1742:a02f140ed897

[project @ 1996-01-12 11:09:39 by jwe]
author jwe
date Fri, 12 Jan 1996 11:21:53 +0000
parents c43d042f20be
children 3a9462b655f1
line wrap: on
line diff
--- a/src/pt-const.cc	Fri Jan 12 11:09:39 1996 +0000
+++ b/src/pt-const.cc	Fri Jan 12 11:21:53 1996 +0000
@@ -1,4 +1,4 @@
-// tree-const.cc                                         -*- C++ -*-
+// pt-const.cc                                         -*- C++ -*-
 /*
 
 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton
@@ -38,6 +38,8 @@
 #include <iostream.h>
 #include <strstream.h>
 
+#include <SLList.h>
+
 #include "mx-base.h"
 #include "Range.h"
 
@@ -45,11 +47,13 @@
 #include "error.h"
 #include "gripes.h"
 #include "idx-vector.h"
+#include "mappers.h"
 #include "oct-map.h"
+#include "oct-obj.h"
 #include "pager.h"
 #include "pr-output.h"
 #include "sysdep.h"
-#include "tree-const.h"
+#include "pt-const.h"
 #include "unwind-prot.h"
 #include "user-prefs.h"
 #include "utils.h"
@@ -356,6 +360,22 @@
   return tree_constant ();
 }
 
+Octave_object
+tree_constant::eval (int print, int, const Octave_object& args)
+{
+  Octave_object retval;
+
+  if (args.length () > 0)
+    retval(0) = rep->do_index (args);
+  else
+    retval(0) = *this;
+
+  if (retval(0).is_defined ())
+    retval(0).eval (print);
+
+  return retval;
+}
+
 void
 tree_constant::print_code (ostream& os)
 {