diff src/symtab.cc @ 7818:5640a70cbab1

Add Ffilemarker and fix for 'dbstep in'
author David Bateman <dbateman@free.fr>
date Sun, 25 May 2008 15:04:37 +0200
parents 71f068b22fcc
children 3e4c9b69069d
line wrap: on
line diff
--- a/src/symtab.cc	Sun May 25 16:32:30 2008 +0200
+++ b/src/symtab.cc	Sun May 25 15:04:37 2008 +0200
@@ -792,7 +792,32 @@
 			     octave_value_list& evaluated_args,
 			     bool& args_evaluated)
 {
-  return find (name, args, arg_names, evaluated_args, args_evaluated, true);
+  octave_value retval;
+  size_t pos = name.find_first_of (Vfilemarker);
+
+  if (pos == NPOS)
+    retval = find (name, args, arg_names, evaluated_args, args_evaluated, true);
+  else
+    {
+      std::string fcn_scope = name.substr(0, pos);
+      scope_id stored_scope = xcurrent_scope;
+      xcurrent_scope = xtop_scope;
+      octave_value parent = find_function (name.substr(0, pos));
+      if (parent.is_defined ())
+	{
+	  octave_function *parent_fcn = parent.function_value ();
+	  if (parent_fcn)
+	    {
+	      xcurrent_scope = parent_fcn->scope ();
+	      if (xcurrent_scope > 1)
+		retval = find_function (name.substr (pos + 1), args, arg_names, 
+					evaluated_args, args_evaluated);
+	    }
+	}
+      xcurrent_scope = stored_scope;
+    }
+
+  return retval;
 }
 
 void