diff libinterp/octave-value/ov.cc @ 23599:5cb3a2bb5e1e

don't use singleton for symbol_table This is the first of a series of changes to make the symbol table a part of the interpreter instead of a global object. These changes also aim to simplify the implementation of symbol table so that it is easier to understand and modify. * Functions now own their scope (workspace) data. * The list of subfunctions is contained in the scope rather than a global list. * symtab.h, symtab.cc (class symbol_table): Don't use singleton pattern. * interpreter.h, interpreter.cc (interpreter::m_symbol_table): New data member. (interpreter::~interpreter): Don't set instance to 0. * interpreter-private.h, interpreter-private.cc (__get_symbol_table__): New function. Change all uses of call_stack to access call_stack object from the interpreter.
author John W. Eaton <jwe@octave.org>
date Fri, 09 Jun 2017 02:21:28 -0400
parents 63950abd2f81
children 7a97944f06e5
line wrap: on
line diff
--- a/libinterp/octave-value/ov.cc	Fri Jun 09 11:36:34 2017 -0400
+++ b/libinterp/octave-value/ov.cc	Fri Jun 09 02:21:28 2017 -0400
@@ -82,6 +82,7 @@
 #include "defun.h"
 #include "error.h"
 #include "errwarn.h"
+#include "interpreter-private.h"
 #include "pager.h"
 #include "parse.h"
 #include "pr-output.h"
@@ -2497,7 +2498,9 @@
       else
         dispatch_type = limit.class_name ();
 
-      octave_value meth = symbol_table::find_method ("colon", dispatch_type);
+      symbol_table& symtab = octave::__get_symbol_table__ ("do_colon_op");
+
+      octave_value meth = symtab.find_method ("colon", dispatch_type);
 
       if (! meth.is_defined ())
         error ("colon method not defined for %s class", dispatch_type.c_str ());