diff src/load-path.cc @ 9010:f914834836e7

Partial implementation of derived classes using the old form with "@" files.
author rtshort@smoketree.phaselocked.com
date Tue, 24 Mar 2009 11:29:53 -0400
parents eb63fbe60fab
children 9b12ed1fbbbd
line wrap: on
line diff
--- a/src/load-path.cc
+++ b/src/load-path.cc
@@ -512,6 +512,7 @@
   fcn_map.clear ();
   private_fcn_map.clear ();
   method_map.clear ();
+  parent_map.clear ();
 
   do_append (".", false);
 }
@@ -1016,7 +1017,29 @@
 
       const_fcn_map_iterator p = m.find (meth);
 
-      if (p != m.end ())
+      if (p == m.end ())
+	{
+	  // Look in parent classes.
+
+	  const_parent_map_iterator r = parent_map.find (class_name);
+
+	  if (r != parent_map.end ())
+	    {
+	      const std::list<std::string>& plist = r->second;
+	      std::list<std::string>::const_iterator it = plist.begin ();
+
+	      while (it != plist.end ())
+		{
+		  retval = do_find_method (*it, meth, dir_name, type);
+
+		  if (retval != "")
+		    break;
+
+		  it++;
+		}
+	    }
+	}
+      else
 	{
 	  const file_info_list_type& file_info_list = p->second;
 
@@ -1538,6 +1561,13 @@
 }
 
 void
+load_path::do_add_to_parent_map (const std::string& classname,
+				 const std::list<std::string>& parent_list) const
+{
+  parent_map[classname] = parent_list;
+}
+
+void
 load_path::add_to_fcn_map (const dir_info& di, bool at_end) const
 {
   std::string dir_name = di.dir_name;