diff libinterp/parse-tree/oct-parse.yy @ 27505:c409d16b7190

eliminate some uses of bare pointers to octave_function objects * pt-classdef.h, pt-classdef.cc (tree_classdef::make_meta_class): Return octave_value instead of pointer to octave_function object. Change all uses. * cdef-class.h, cdef-class.cc (cdef_class::get_method_function, cdef_class::get_constructor_function): Return octave_value instead of pointer to octave_function object. Change all uses. * cdef-manager.h, cdef-manager.cc (classdef_manager::find_method_symbol, classdef_manager::find_package_symbol): Return octave_value instead of pointer to octave_function object. Change all uses. * parse.h, oct-parse.yy (base_parser::primary_fcn): Rename from primary_fcn_ptr and store octave_value instead of pointer to octave_function object. Change all uses.
author John W. Eaton <jwe@octave.org>
date Thu, 10 Oct 2019 13:54:14 -0400
parents 7a31b25e3252
children 2d537a089e5d
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.yy	Thu Oct 10 13:33:33 2019 -0400
+++ b/libinterp/parse-tree/oct-parse.yy	Thu Oct 10 13:54:14 2019 -0400
@@ -1475,7 +1475,7 @@
                         // after parsing the function.  Any function
                         // definitions found in the file have already
                         // been stored in the symbol table or in
-                        // base_parser::m_primary_fcn_ptr.
+                        // base_parser::m_primary_fcn.
 
                         // Unused symbol table context.
                         lexer.m_symtab_context.pop ();
@@ -2184,9 +2184,8 @@
       m_parsing_subfunctions (false), m_parsing_local_functions (false),
       m_max_fcn_depth (-1), m_curr_fcn_depth (-1), m_primary_fcn_scope (),
       m_curr_class_name (), m_curr_package_name (), m_function_scopes (),
-      m_primary_fcn_ptr (nullptr), m_subfunction_names (),
-      m_classdef_object (), m_stmt_list (), m_lexer (lxr),
-      m_parser_state (yypstate_new ())
+      m_primary_fcn (), m_subfunction_names (), m_classdef_object (),
+      m_stmt_list (), m_lexer (lxr), m_parser_state (yypstate_new ())
   { }
 
   base_parser::~base_parser (void)
@@ -2218,7 +2217,7 @@
     m_curr_class_name = "";
     m_curr_package_name = "";
     m_function_scopes.clear ();
-    m_primary_fcn_ptr  = nullptr;
+    m_primary_fcn = octave_value ();
     m_subfunction_names.clear ();
     m_classdef_object.reset ();
     m_stmt_list.reset ();
@@ -3289,7 +3288,7 @@
 
     script->stash_fcn_file_time (now);
 
-    m_primary_fcn_ptr = script;
+    m_primary_fcn = octave_value (script);
   }
 
   // Define a function.
@@ -3452,7 +3451,7 @@
 
     if (m_lexer.m_reading_fcn_file && m_curr_fcn_depth == 0
         && ! m_parsing_subfunctions)
-      m_primary_fcn_ptr = fcn;
+      m_primary_fcn = octave_value (fcn);
 
     return fcn;
   }
@@ -3528,7 +3527,7 @@
             // Otherwise, it is just inserted in the symbol table,
             // either as a subfunction or nested function (see above),
             // or as the primary function for the file, via
-            // m_primary_fcn_ptr (see also load_fcn_from_file,,
+            // m_primary_fcn (see also load_fcn_from_file,,
             // parse_fcn_file, and
             // fcn_info::fcn_info_rep::find_user_function).