diff libinterp/octave-value/ov-fcn-handle.cc @ 26113:8a15f3bace49

move eval_string inside interpreter/evaluator class * tree_evaluator.h, tree_evaluator.cc (tree_evaluator::eval_string): New functions. * interpreter.h, interpreter.cc (interpreter::eval_string): New functions. Forward to evaluator eval_string functions. * parse.h, oct-parse.yy (eval_string): Deprecate and forward to interpreter eval_string functions. Change all uses. * pt.h, pt.cc (tree::meets_bp_condition): Accept reference to tree_evaluator as argument. Change all uses. (tree::is_breakpoint): Split into separate is_breakpoint and is_active_breakpoint functions. Change all uses.
author John W. Eaton <jwe@octave.org>
date Fri, 16 Nov 2018 13:16:50 -0500
parents 7eeb89b0d2d5
children 7502fce4cd3a
line wrap: on
line diff
--- a/libinterp/octave-value/ov-fcn-handle.cc	Tue Dec 20 03:25:17 2016 +0000
+++ b/libinterp/octave-value/ov-fcn-handle.cc	Fri Nov 16 13:16:50 2018 -0500
@@ -405,10 +405,12 @@
 {
   bool success = true;
 
-  int parse_status;
+  octave::interpreter& interp
+    = octave::__get_interpreter__ ("octave_fcn_handle::parse_anon_fcn_handle");
 
-  octave_value anon_fcn_handle =
-    octave::eval_string (fcn_text, true, parse_status);
+  int parse_status;
+  octave_value anon_fcn_handle
+    = interp.eval_string (fcn_text, true, parse_status);
 
   if (parse_status == 0)
     {
@@ -1848,8 +1850,8 @@
   return retval;
 }
 
-DEFUN (str2func, args, ,
-       doc: /* -*- texinfo -*-
+DEFMETHOD (str2func, interp, args, ,
+           doc: /* -*- texinfo -*-
 @deftypefn  {} {} str2func (@var{fcn_name})
 @deftypefnx {} {} str2func (@var{fcn_name}, "global")
 Return a function handle constructed from the string @var{fcn_name}.
@@ -1872,7 +1874,7 @@
     {
       int parse_status;
       octave_value anon_fcn_handle
-        = octave::eval_string (nm, true, parse_status);
+        = interp.eval_string (nm, true, parse_status);
 
       if (parse_status == 0)
         retval = anon_fcn_handle;