# HG changeset patch # User John W. Eaton # Date 1510886627 18000 # Node ID bc3819b7cca197d16e960aaa9c01df70cef67f23 # Parent f494b87d2a93b7a0042ddcaa7320197622c66270 don't use symbol_table:: nesting for symbol_record, symbol_scope, or fcn_info Change all uses of symbol_table::symbol_record to symbol_record. Change all uses of symbol_table::scope to symbol_scope. Change all uses of symbol_table::fcn_info to fcn_info. diff -r f494b87d2a93 -r bc3819b7cca1 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libgui/src/main-window.cc Thu Nov 16 21:43:47 2017 -0500 @@ -2537,7 +2537,7 @@ { Fload (ovl (file)); - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__get_current_scope__ ("main_window::load_workspace_callback"); if (scope) @@ -2547,7 +2547,7 @@ void main_window::rename_variable_callback (const main_window::name_pair& names) { - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__get_current_scope__ ("main_window::rename_variable_callback"); if (scope) @@ -2713,7 +2713,7 @@ void main_window::force_refresh_workspace (void) { - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__get_current_scope__ ("main_window::load_workspace_callback"); if (scope) diff -r f494b87d2a93 -r bc3819b7cca1 libgui/src/workspace-view.cc --- a/libgui/src/workspace-view.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libgui/src/workspace-view.cc Thu Nov 16 21:43:47 2017 -0500 @@ -409,7 +409,7 @@ { QString var_name = get_var_name (index); - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__get_current_scope__ ("workspace_view::handle_contextmenu_copy_value"); octave_value val = scope ? scope->varval (var_name.toStdString ()) : 0; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/call-stack.cc --- a/libinterp/corefcn/call-stack.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/call-stack.cc Thu Nov 16 21:43:47 2017 -0500 @@ -361,7 +361,7 @@ } void - call_stack::push (octave_function *fcn, symbol_table::scope *scope, + call_stack::push (octave_function *fcn, symbol_scope *scope, symbol_table::context_id context) { size_t prev_frame = curr_frame; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/call-stack.h --- a/libinterp/corefcn/call-stack.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/call-stack.h Thu Nov 16 21:43:47 2017 -0500 @@ -52,7 +52,7 @@ friend class call_stack; stack_frame (octave_function *fcn = nullptr, - symbol_table::scope *scope = nullptr, + symbol_scope *scope = nullptr, symbol_table::context_id context = 0, size_t prev = 0) : m_fcn (fcn), m_line (-1), m_column (-1), m_scope (scope), m_context (context), m_prev (prev) @@ -78,7 +78,7 @@ octave_function *m_fcn; int m_line; int m_column; - symbol_table::scope *m_scope; + symbol_scope *m_scope; symbol_table::context_id m_context; size_t m_prev; }; @@ -124,7 +124,7 @@ size_t num_user_code_frames (octave_idx_type& curr_user_frame) const; - symbol_table::scope *current_scope (void) const + symbol_scope *current_scope (void) const { return (curr_frame > 0 && curr_frame < cs.size () ? cs[curr_frame].m_scope : nullptr); @@ -173,7 +173,7 @@ bool all_scripts (void) const; void push (octave_function *fcn); - void push (octave_function *fcn, symbol_table::scope *scope, + void push (octave_function *fcn, symbol_scope *scope, symbol_table::context_id context); void push (void) @@ -181,7 +181,7 @@ push (nullptr); } - void push (symbol_table::scope *scope, symbol_table::context_id context) + void push (symbol_scope *scope, symbol_table::context_id context) { push (nullptr, scope, context); } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/error.cc Thu Nov 16 21:43:47 2017 -0500 @@ -1568,7 +1568,7 @@ if (nargin == 3 && argv[3] == "local" && ! symtab.at_top_level ()) { - octave::symbol_table::scope *scope + octave::symbol_scope *scope = symtab.require_current_scope ("warning"); octave_scalar_map val = warning_query (arg2); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/help.cc Thu Nov 16 21:43:47 2017 -0500 @@ -494,7 +494,7 @@ // All subfunctions are listed in the top-level function of this file. while (curr_fcn->is_subfunction ()) { - symbol_table::scope *pscope = curr_fcn->parent_fcn_scope (); + symbol_scope *pscope = curr_fcn->parent_fcn_scope (); curr_fcn = pscope->function (); } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/interpreter-private.cc --- a/libinterp/corefcn/interpreter-private.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/interpreter-private.cc Thu Nov 16 21:43:47 2017 -0500 @@ -79,16 +79,16 @@ return interp.get_symbol_table (); } - symbol_table::scope *__get_current_scope__ (const std::string& who) + symbol_scope *__get_current_scope__ (const std::string& who) { interpreter& interp = __get_interpreter__ (who); return interp.get_current_scope (); } - symbol_table::scope *__require_current_scope__ (const std::string& who) + symbol_scope *__require_current_scope__ (const std::string& who) { - symbol_table::scope *scope = __get_current_scope__ (who); + symbol_scope *scope = __get_current_scope__ (who); if (! scope) error ("%s: symbol table scope missing", who.c_str ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/interpreter-private.h --- a/libinterp/corefcn/interpreter-private.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/interpreter-private.h Thu Nov 16 21:43:47 2017 -0500 @@ -51,9 +51,9 @@ extern symbol_table& __get_symbol_table__ (const std::string& who); - extern symbol_table::scope *__get_current_scope__ (const std::string& who); + extern symbol_scope *__get_current_scope__ (const std::string& who); - extern symbol_table::scope * + extern symbol_scope * __require_current_scope__ (const std::string& who); extern tree_evaluator& __get_evaluator__ (const std::string& who); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/interpreter.cc Thu Nov 16 21:43:47 2017 -0500 @@ -539,7 +539,7 @@ void interpreter::intern_nargin (octave_idx_type nargs) { // FIXME: should this explicitly be top_scope? - symbol_table::scope *scope = m_symbol_table.current_scope (); + symbol_scope *scope = m_symbol_table.current_scope (); if (scope) { @@ -1177,16 +1177,16 @@ return m_url_handle_manager; } - symbol_table::scope * + symbol_scope * interpreter::get_current_scope (void) { return m_symbol_table.current_scope (); } - symbol_table::scope * + symbol_scope * interpreter::require_current_scope (const std::string& who) { - symbol_table::scope *scope = get_current_scope (); + symbol_scope *scope = get_current_scope (); if (! scope) error ("%s: symbol table scope missing", who.c_str ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/interpreter.h --- a/libinterp/corefcn/interpreter.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/interpreter.h Thu Nov 16 21:43:47 2017 -0500 @@ -167,8 +167,8 @@ return m_symbol_table; } - symbol_table::scope * get_current_scope (void); - symbol_table::scope * require_current_scope (const std::string& who); + symbol_scope * get_current_scope (void); + symbol_scope * require_current_scope (const std::string& who); call_stack& get_call_stack (void); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/load-path.cc Thu Nov 16 21:43:47 2017 -0500 @@ -121,7 +121,7 @@ // Look in private directory corresponding to current function (if // any). - octave::symbol_table::scope *scope = octave::__get_current_scope__ ("find_private_file"); + octave::symbol_scope *scope = octave::__get_current_scope__ ("find_private_file"); octave_user_function *curr_fcn = scope ? scope->function () : nullptr; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/load-save.cc Thu Nov 16 21:43:47 2017 -0500 @@ -148,7 +148,7 @@ octave::symbol_table& symtab = octave::__get_symbol_table__ ("install_loaded_varaible"); - octave::symbol_table::scope *scope + octave::symbol_scope *scope = symtab.require_current_scope ("install_loaded_variable"); if (global) @@ -959,7 +959,7 @@ // Save the info from SR on stream OS in the format specified by FMT. void -do_save (std::ostream& os, const octave::symbol_table::symbol_record& sr, +do_save (std::ostream& os, const octave::symbol_record& sr, load_save_format fmt, bool save_as_floats) { octave_value val = sr.varval (); @@ -1011,7 +1011,7 @@ { octave::symbol_table& symtab = octave::__get_symbol_table__ ("save_vars"); - std::list vars = symtab.glob (pattern); + std::list vars = symtab.glob (pattern); size_t saved = 0; @@ -1278,7 +1278,7 @@ std::string struct_name = argv[argv_idx]; - octave::symbol_table::scope *scope = octave::__get_current_scope__ ("save_vars"); + octave::symbol_scope *scope = octave::__get_current_scope__ ("save_vars"); octave_value struct_var; @@ -1332,9 +1332,9 @@ octave::symbol_table& symtab = octave::__get_symbol_table__ ("dump_octave_core"); - octave::symbol_table::scope *top_scope = symtab.top_scope (); + octave::symbol_scope *top_scope = symtab.top_scope (); - std::list vars = top_scope->all_variables (); + std::list vars = top_scope->all_variables (); double save_mem_size = 0; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/load-save.h --- a/libinterp/corefcn/load-save.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/load-save.h Thu Nov 16 21:43:47 2017 -0500 @@ -86,7 +86,7 @@ extern OCTINTERP_API bool is_octave_data_file (const std::string& file); extern void -do_save (std::ostream& os, const octave::symbol_table::symbol_record& sr, +do_save (std::ostream& os, const octave::symbol_record& sr, load_save_format fmt, bool save_as_floats); extern void diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/ls-mat5.cc Thu Nov 16 21:43:47 2017 -0500 @@ -976,7 +976,7 @@ octave::symbol_table& symtab = octave::__get_symbol_table__ ("read_mat5_binary_element"); - octave::symbol_table::scope local_scope; + octave::symbol_scope local_scope; symtab.set_scope (&local_scope); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/mex.cc --- a/libinterp/corefcn/mex.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/mex.cc Thu Nov 16 21:43:47 2017 -0500 @@ -3476,7 +3476,7 @@ frame.add_method (cs, &octave::call_stack::pop); } - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__require_current_scope__ ("mexGetVariable"); val = scope->varval (name); @@ -3547,7 +3547,7 @@ frame.add_method (cs, &octave::call_stack::pop); } - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__require_current_scope__ ("mexPutVariable"); scope->assign (name, mxArray::as_octave_value (ptr)); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/oct-lvalue.h --- a/libinterp/corefcn/oct-lvalue.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/oct-lvalue.h Thu Nov 16 21:43:47 2017 -0500 @@ -38,8 +38,8 @@ { public: - octave_lvalue (const octave::symbol_table::symbol_record& s - = octave::symbol_table::symbol_record ()) + octave_lvalue (const octave::symbol_record& s + = octave::symbol_record ()) : sym (s), black_hole (false), type (), idx (), nel (1) { } @@ -101,7 +101,7 @@ private: - octave::symbol_table::symbol_record sym; + octave::symbol_record sym; bool black_hole; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/octave-link.cc --- a/libinterp/corefcn/octave-link.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/octave-link.cc Thu Nov 16 21:43:47 2017 -0500 @@ -71,7 +71,7 @@ = octave::__get_symbol_table__ ("octave_link::set_workspace"); std::list workspace_info; - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); if (scope) workspace_info = scope->workspace_info (); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/corefcn/variables.cc Thu Nov 16 21:43:47 2017 -0500 @@ -204,7 +204,7 @@ if (! name.empty ()) { - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); octave_value val = scope ? scope->varval (name) : octave_value (); @@ -328,7 +328,7 @@ if (! args(0).is_string ()) error ("isglobal: NAME must be a string"); - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); std::string name = args(0).string_value (); @@ -389,7 +389,7 @@ if (search_any || search_var) { - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); octave_value val = scope ? scope->varval (name) : octave_value (); @@ -1130,7 +1130,7 @@ private: struct symbol_info { - symbol_info (const octave::symbol_table::symbol_record& sr, + symbol_info (const octave::symbol_record& sr, const std::string& expr_str = "", const octave_value& expr_val = octave_value ()) : name (expr_str.empty () ? sr.name () : expr_str), @@ -1294,12 +1294,12 @@ ~symbol_info_list (void) = default; - void append (const octave::symbol_table::symbol_record& sr) + void append (const octave::symbol_record& sr) { lst.push_back (symbol_info (sr)); } - void append (const octave::symbol_table::symbol_record& sr, + void append (const octave::symbol_record& sr, const std::string& expr_str, const octave_value& expr_val) { @@ -1650,7 +1650,7 @@ // Set up temporary scope. - octave::symbol_table::scope tmp_scope; + octave::symbol_scope tmp_scope; symtab.set_scope (&tmp_scope); @@ -1693,7 +1693,7 @@ symbol_info_list symbol_stats; std::list symbol_names; - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); for (int j = 0; j < npats; j++) { @@ -1701,7 +1701,7 @@ if (have_regexp) { - std::list tmp + std::list tmp = (global_only ? symtab.regexp_global_variables (pat) : symtab.regexp_variables (pat)); @@ -1736,7 +1736,7 @@ if (scope && scope->is_variable (base_name)) { - octave::symbol_table::symbol_record sr + octave::symbol_record sr = symtab.find_symbol (base_name); if (! global_only || sr.is_global ()) @@ -1753,7 +1753,7 @@ } else { - std::list tmp + std::list tmp = (global_only ? symtab.glob_global_variables (pat) : symtab.glob_variables (pat)); @@ -2100,7 +2100,7 @@ const string_vector& argv, int argc, int idx, bool exclusive = false) { - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); if (! scope) return; @@ -2143,7 +2143,7 @@ const string_vector& argv, int argc, int idx, bool exclusive = false, bool have_regexp = false) { - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); if (! scope) return; @@ -2185,7 +2185,7 @@ { if (idx == argc) { - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); if (scope) scope->clear_variables (); @@ -2216,7 +2216,7 @@ { // This is supposed to be mostly Matlab compatible. - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); if (! scope) return; @@ -2365,7 +2365,7 @@ bool have_regexp = false; bool have_dash_option = false; - octave::symbol_table::scope *scope = symtab.current_scope (); + octave::symbol_scope *scope = symtab.current_scope (); while (++idx < argc) { @@ -2605,7 +2605,7 @@ std::string name = args(0).xstring_value ("__varval__: first argument must be a variable name"); - octave::symbol_table::scope *scope = interp.get_current_scope (); + octave::symbol_scope *scope = interp.get_current_scope (); return scope ? scope->varval (args(0).string_value ()) : octave_value (); } @@ -2696,7 +2696,7 @@ void clear_variable (const std::string& nm) { - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__get_current_scope__ ("clear_variable"); if (scope) @@ -2714,7 +2714,7 @@ octave_value lookup_function_handle (const std::string& nm) { - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__get_current_scope__ ("lookup_function_handle"); octave_value val = scope ? scope->varval (nm) : octave_value (); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/octave-value/ov-classdef.cc Thu Nov 16 21:43:47 2017 -0500 @@ -1113,7 +1113,7 @@ error ("cannot call superclass constructor with variable `%s'", mname.c_str ()); - octave::symbol_table::scope *scope + octave::symbol_scope *scope = octave::__require_current_scope__ ("octave_classdef_superclass_ref::call"); octave_value sym = scope->varval (mname); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/octave-value/ov-fcn-handle.cc Thu Nov 16 21:43:47 2017 -0500 @@ -86,7 +86,7 @@ if (uf && nm != anonymous) { - octave::symbol_table::scope *uf_scope = uf->scope (); + octave::symbol_scope *uf_scope = uf->scope (); if (uf_scope) uf_scope->cache_name (nm); @@ -349,10 +349,10 @@ if (fcn.is_undefined ()) return false; - std::list vars; + std::list vars; octave_user_function *f = fcn.user_function_value (); - octave::symbol_table::scope *f_scope = f->scope (); + octave::symbol_scope *f_scope = f->scope (); if (f_scope) vars = f_scope->all_variables (); @@ -406,7 +406,7 @@ if (uf) { - octave::symbol_table::scope *uf_scope = uf->scope (); + octave::symbol_scope *uf_scope = uf->scope (); if (uf_scope) uf_scope->cache_name (nm); @@ -468,7 +468,7 @@ octave::symbol_table& symtab = octave::__get_symbol_table__ ("octave_fcn_handle::load_ascii"); - octave::symbol_table::scope local_scope; + octave::symbol_scope local_scope; symtab.set_scope (&local_scope); @@ -526,10 +526,10 @@ if (fcn.is_undefined ()) return false; - std::list vars; + std::list vars; octave_user_function *f = fcn.user_function_value (); - octave::symbol_table::scope *f_scope = f->scope (); + octave::symbol_scope *f_scope = f->scope (); if (f_scope) vars = f_scope->all_variables (); @@ -634,7 +634,7 @@ octave::symbol_table& symtab = octave::__get_symbol_table__ ("octave_fcn_handle::load_binary"); - octave::symbol_table::scope local_scope; + octave::symbol_scope local_scope; symtab.set_scope (&local_scope); @@ -782,10 +782,10 @@ H5Dclose (data_hid); - std::list vars; + std::list vars; octave_user_function *f = fcn.user_function_value (); - octave::symbol_table::scope *f_scope = f->scope (); + octave::symbol_scope *f_scope = f->scope (); if (f_scope) vars = f_scope->all_variables (); @@ -1136,7 +1136,7 @@ octave::symbol_table& symtab = octave::__get_symbol_table__ ("octave_fcn_handle::load_hdf5"); - octave::symbol_table::scope local_scope; + octave::symbol_scope local_scope; symtab.set_scope (&local_scope); @@ -1755,10 +1755,10 @@ { m.setfield ("file", nm); - std::list vars; + std::list vars; octave_user_function *fu = fh->user_function_value (); - octave::symbol_table::scope *fu_scope = fu->scope (); + octave::symbol_scope *fu_scope = fu->scope (); if (fu_scope) vars = fu_scope->all_variables (); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/octave-value/ov-fcn-inline.cc --- a/libinterp/octave-value/ov-fcn-inline.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/octave-value/ov-fcn-inline.cc Thu Nov 16 21:43:47 2017 -0500 @@ -104,7 +104,7 @@ if (curr_fcn) { - octave::symbol_table::scope *parent_scope + octave::symbol_scope *parent_scope = curr_fcn->parent_fcn_scope (); if (! parent_scope) diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/octave-value/ov-fcn.h --- a/libinterp/octave-value/ov-fcn.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/octave-value/ov-fcn.h Thu Nov 16 21:43:47 2017 -0500 @@ -80,12 +80,12 @@ virtual std::string parent_fcn_name (void) const { return ""; } - virtual octave::symbol_table::scope * parent_fcn_scope (void) const + virtual octave::symbol_scope * parent_fcn_scope (void) const { return nullptr; } virtual void mark_fcn_file_up_to_date (const octave::sys::time&) { } - virtual octave::symbol_table::scope * scope (void) { return nullptr; } + virtual octave::symbol_scope * scope (void) { return nullptr; } virtual octave::sys::time time_parsed (void) const { return octave::sys::time (static_cast (0)); } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/octave-value/ov-usr-fcn.cc Thu Nov 16 21:43:47 2017 -0500 @@ -134,7 +134,7 @@ octave_user_script::octave_user_script (const std::string& fnm, const std::string& nm, - octave::symbol_table::scope *scope, octave::tree_statement_list *cmds, + octave::symbol_scope *scope, octave::tree_statement_list *cmds, const std::string& ds) : octave_user_code (nm, scope, ds), cmd_list (cmds), file_name (fnm), t_parsed (static_cast (0)), @@ -147,7 +147,7 @@ octave_user_script::octave_user_script (const std::string& fnm, const std::string& nm, - octave::symbol_table::scope *scope, const std::string& ds) + octave::symbol_scope *scope, const std::string& ds) : octave_user_code (nm, scope, ds), cmd_list (nullptr), file_name (fnm), t_parsed (static_cast (0)), t_checked (static_cast (0)), @@ -206,7 +206,7 @@ octave::profiler::enter block (profiler, *this); frame.add_method (m_scope, - &octave::symbol_table::scope::unbind_script_symbols); + &octave::symbol_scope::unbind_script_symbols); m_scope->bind_script_symbols (tw.get_current_scope ()); if (tw.echo ()) @@ -241,7 +241,7 @@ // extrinsic/intrinsic state?). octave_user_function::octave_user_function - (octave::symbol_table::scope *scope, octave::tree_parameter_list *pl, + (octave::symbol_scope *scope, octave::tree_parameter_list *pl, octave::tree_parameter_list *rl, octave::tree_statement_list *cl) : octave_user_code ("", scope, ""), param_list (pl), ret_list (rl), cmd_list (cl), @@ -361,7 +361,7 @@ } void -octave_user_function::stash_parent_fcn_scope (octave::symbol_table::scope *ps) +octave_user_function::stash_parent_fcn_scope (octave::symbol_scope *ps) { parent_scope = ps; } @@ -552,7 +552,7 @@ << " context: " << m_scope->current_context () << std::endl; #endif - frame.add_method (m_scope, &octave::symbol_table::scope::pop_context); + frame.add_method (m_scope, &octave::symbol_scope::pop_context); } string_vector arg_names = _args.name_tags (); @@ -606,7 +606,7 @@ // declared global will be unmarked as global before they are // undefined by the clear_param_list cleanup function. - frame.add_method (m_scope, &octave::symbol_table::scope::clear_variables); + frame.add_method (m_scope, &octave::symbol_scope::clear_variables); } bind_automatic_vars (tw, arg_names, args.length (), nargout, @@ -927,7 +927,7 @@ } else { - octave::symbol_table::scope *scope = symtab.require_current_scope ("nargin"); + octave::symbol_scope *scope = symtab.require_current_scope ("nargin"); retval = scope->varval (".nargin."); if (retval.is_undefined ()) @@ -1053,7 +1053,7 @@ if (symtab.at_top_level ()) error ("nargout: invalid call at top level"); - octave::symbol_table::scope *scope = symtab.require_current_scope ("nargout"); + octave::symbol_scope *scope = symtab.require_current_scope ("nargout"); retval = scope->varval (".nargout."); if (retval.is_undefined ()) @@ -1126,7 +1126,7 @@ if (symtab.at_top_level ()) error ("isargout: invalid call at top level"); - octave::symbol_table::scope *scope = symtab.require_current_scope ("isargout"); + octave::symbol_scope *scope = symtab.require_current_scope ("isargout"); int nargout1 = scope->varval (".nargout.").int_value (); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/octave-value/ov-usr-fcn.h --- a/libinterp/octave-value/ov-usr-fcn.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/octave-value/ov-usr-fcn.h Thu Nov 16 21:43:47 2017 -0500 @@ -61,7 +61,7 @@ protected: octave_user_code (const std::string& nm, - octave::symbol_table::scope *scope = nullptr, + octave::symbol_scope *scope = nullptr, const std::string& ds = "") : octave_function (nm, ds), m_scope (scope), m_file_info (nullptr), curr_unwind_protect_frame (nullptr) @@ -97,7 +97,7 @@ void cache_function_text (const std::string& text, const octave::sys::time& timestamp); - octave::symbol_table::scope *scope (void) { return m_scope; } + octave::symbol_scope *scope (void) { return m_scope; } virtual std::map subfunctions (void) const; @@ -108,7 +108,7 @@ void get_file_info (void); // Our symbol table scope. - octave::symbol_table::scope *m_scope; + octave::symbol_scope *m_scope; // Cached text of function or script code with line offsets // calculated. @@ -128,12 +128,12 @@ octave_user_script (void); octave_user_script (const std::string& fnm, const std::string& nm, - octave::symbol_table::scope *scope = nullptr, + octave::symbol_scope *scope = nullptr, octave::tree_statement_list *cmds = nullptr, const std::string& ds = ""); octave_user_script (const std::string& fnm, const std::string& nm, - octave::symbol_table::scope *scope = nullptr, + octave::symbol_scope *scope = nullptr, const std::string& ds = ""); // No copying! @@ -207,7 +207,7 @@ { public: - octave_user_function (octave::symbol_table::scope *scope = nullptr, + octave_user_function (octave::symbol_scope *scope = nullptr, octave::tree_parameter_list *pl = nullptr, octave::tree_parameter_list *rl = nullptr, octave::tree_statement_list *cl = nullptr); @@ -260,7 +260,7 @@ void stash_parent_fcn_name (const std::string& p) { parent_name = p; } - void stash_parent_fcn_scope (octave::symbol_table::scope *ps); + void stash_parent_fcn_scope (octave::symbol_scope *ps); void stash_leading_comment (octave::comment_list *lc) { lead_comm = lc; } @@ -280,7 +280,7 @@ std::string parent_fcn_name (void) const { return parent_name; } - octave::symbol_table::scope * + octave::symbol_scope * parent_fcn_scope (void) const { return parent_scope; } octave::sys::time time_parsed (void) const { return t_parsed; } @@ -488,7 +488,7 @@ bool class_method; // The scope of the parent function, if any. - octave::symbol_table::scope *parent_scope; + octave::symbol_scope *parent_scope; #if defined (HAVE_LLVM) octave::jit_function_info *jit_info; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/lex.h Thu Nov 16 21:43:47 2017 -0500 @@ -69,17 +69,17 @@ void pop (void); - void push (symbol_table::scope *scope) + void push (symbol_scope *scope) { frame_stack.push_front (scope); } - symbol_table::scope *curr_scope (void) const; - symbol_table::scope *parent_scope (void) const; + symbol_scope *curr_scope (void) const; + symbol_scope *parent_scope (void) const; private: - std::deque frame_stack; + std::deque frame_stack; }; // Track nesting of square brackets, curly braces, and parentheses. @@ -602,7 +602,7 @@ bool inside_any_object_index (void); - bool is_variable (const std::string& name, symbol_table::scope *scope); + bool is_variable (const std::string& name, symbol_scope *scope); int is_keyword_token (const std::string& s); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/lex.ll Thu Nov 16 21:43:47 2017 -0500 @@ -2080,7 +2080,7 @@ { while (! frame_stack.empty ()) { - symbol_table::scope *scope = curr_scope (); + symbol_scope *scope = curr_scope (); delete scope; @@ -2097,12 +2097,12 @@ frame_stack.pop_front (); } - symbol_table::scope * + symbol_scope * lexical_feedback::symbol_table_context::curr_scope (void) const { if (empty ()) { - symbol_table::scope *scope + symbol_scope *scope = __get_current_scope__ ("lexical_feedback::symbol_table_context::curr_scope"); return scope; @@ -2111,7 +2111,7 @@ return frame_stack.front (); } - symbol_table::scope * + symbol_scope * lexical_feedback::symbol_table_context::parent_scope (void) const { size_t sz = size (); @@ -2522,7 +2522,7 @@ bool base_lexer::is_variable (const std::string& name, - symbol_table::scope *scope) + symbol_scope *scope) { return ((scope && scope->is_variable (name)) || (pending_local_variables.find (name) @@ -3156,12 +3156,12 @@ // Find the token in the symbol table. - symbol_table::scope *scope = symtab_context.curr_scope (); - - symbol_table::symbol_record sr + symbol_scope *scope = symtab_context.curr_scope (); + + symbol_record sr = (scope ? scope->insert (ident) - : symbol_table::symbol_record (scope, ident)); + : symbol_record (scope, ident)); token *tok = new token (NAME, sr, input_line_number, current_input_column); @@ -3344,7 +3344,7 @@ case NAME: { token *tok_val = current_token (); - symbol_table::symbol_record sr = tok_val->sym_rec (); + symbol_record sr = tok_val->sym_rec (); std::cerr << "NAME [" << sr.name () << "]\n"; } break; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu Nov 16 21:43:47 2017 -0500 @@ -501,7 +501,7 @@ identifier : NAME { - octave::symbol_table::symbol_record sr = $1->sym_rec (); + octave::symbol_record sr = $1->sym_rec (); $$ = new octave::tree_identifier (sr, $1->line (), $1->column ()); } ; @@ -1276,7 +1276,7 @@ if (parser.m_max_fcn_depth < parser.m_curr_fcn_depth) parser.m_max_fcn_depth = parser.m_curr_fcn_depth; - lexer.symtab_context.push (new octave::symbol_table::scope ()); + lexer.symtab_context.push (new octave::symbol_scope ()); parser.m_function_scopes.push (lexer.symtab_context.curr_scope ()); @@ -1306,7 +1306,7 @@ if (lexer.looking_at_function_handle) { - lexer.symtab_context.push (new octave::symbol_table::scope ()); + lexer.symtab_context.push (new octave::symbol_scope ()); lexer.looking_at_function_handle--; lexer.looking_at_anon_fcn_args = true; } @@ -1443,7 +1443,7 @@ { $$ = 0; - lexer.symtab_context.push (new octave::symbol_table::scope ()); + lexer.symtab_context.push (new octave::symbol_scope ()); } ; @@ -1530,7 +1530,7 @@ YYABORT; } - octave::symbol_table::scope *curr_scope + octave::symbol_scope *curr_scope = lexer.symtab_context.curr_scope (); curr_scope->cache_name (id); @@ -2092,7 +2092,7 @@ } void - base_parser::parent_scope_info::push (symbol_table::scope *scope) + base_parser::parent_scope_info::push (symbol_scope *scope) { push (value_type (scope, "")); } @@ -2145,7 +2145,7 @@ return true; } - symbol_table::scope * + symbol_scope * base_parser::parent_scope_info::parent_scope (void) const { return size () > 1 ? m_info[size()-2].first : nullptr; @@ -2439,8 +2439,8 @@ int l = m_lexer.input_line_number; int c = m_lexer.current_input_column; - symbol_table::scope *fcn_scope = m_lexer.symtab_context.curr_scope (); - symbol_table::scope *parent_scope = m_lexer.symtab_context.parent_scope (); + symbol_scope *fcn_scope = m_lexer.symtab_context.curr_scope (); + symbol_scope *parent_scope = m_lexer.symtab_context.parent_scope (); m_lexer.symtab_context.pop (); @@ -3239,7 +3239,7 @@ cmds->append (end_script); - symbol_table::scope *script_scope = m_lexer.symtab_context.curr_scope (); + symbol_scope *script_scope = m_lexer.symtab_context.curr_scope (); script_scope->cache_name (m_lexer.fcn_file_full_name); @@ -3450,7 +3450,7 @@ if (! file.empty ()) tmp += ": " + file; - symbol_table::scope *fcn_scope = fcn->scope (); + symbol_scope *fcn_scope = fcn->scope (); fcn_scope->cache_name (tmp); if (lc) @@ -3466,7 +3466,7 @@ if (m_endfunction_found && m_function_scopes.size () > 1) { - symbol_table::scope *pscope = m_function_scopes.parent_scope (); + symbol_scope *pscope = m_function_scopes.parent_scope (); pscope->install_nestfunction (nm, ov_fcn); } @@ -3492,7 +3492,7 @@ // or as the primary function for the file, via // m_primary_fcn_ptr (see also load_fcn_from_file,, // parse_fcn_file, and - // symbol_table::fcn_info::fcn_info_rep::find_user_function). + // fcn_info::fcn_info_rep::find_user_function). if (m_lexer.buffer_function_text) { @@ -5632,7 +5632,7 @@ if (octave::is_keyword (nm)) error ("assignin: invalid assignment to keyword '%s'", nm.c_str ()); - octave::symbol_table::scope *scope = interp.get_current_scope (); + octave::symbol_scope *scope = interp.get_current_scope (); if (scope) scope->assign (nm, args(2)); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/parse.h --- a/libinterp/parse-tree/parse.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/parse.h Thu Nov 16 21:43:47 2017 -0500 @@ -101,7 +101,7 @@ { public: - typedef std::pair value_type; + typedef std::pair value_type; typedef std::deque::iterator iterator; typedef std::deque::const_iterator const_iterator; @@ -121,7 +121,7 @@ void push (const value_type& elt); - void push (symbol_table::scope *id); + void push (symbol_scope *id); void pop (void); @@ -129,7 +129,7 @@ bool name_current_scope (const std::string& name); - symbol_table::scope *parent_scope (void) const; + symbol_scope *parent_scope (void) const; std::string parent_name (void) const; @@ -448,7 +448,7 @@ // Scope where we install all subfunctions and nested functions. Only // used while reading function files. - symbol_table::scope *m_primary_fcn_scope; + symbol_scope *m_primary_fcn_scope; // Name of the current class when we are parsing class methods or // constructors. diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-arg-list.cc --- a/libinterp/parse-tree/pt-arg-list.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-arg-list.cc Thu Nov 16 21:43:47 2017 -0500 @@ -303,7 +303,7 @@ } tree_argument_list * - tree_argument_list::dup (symbol_table::scope& scope) const + tree_argument_list::dup (symbol_scope& scope) const { tree_argument_list *new_list = new tree_argument_list (); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-arg-list.h --- a/libinterp/parse-tree/pt-arg-list.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-arg-list.h Thu Nov 16 21:43:47 2017 -0500 @@ -96,7 +96,7 @@ std::list variable_names (void) const; - tree_argument_list * dup (symbol_table::scope& scope) const; + tree_argument_list * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-array-list.cc --- a/libinterp/parse-tree/pt-array-list.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-array-list.cc Thu Nov 16 21:43:47 2017 -0500 @@ -79,7 +79,7 @@ void tree_array_list::copy_base (const tree_array_list& array_list, - symbol_table::scope& scope) + symbol_scope& scope) { for (const tree_argument_list *elt : array_list) append (elt ? elt->dup (scope) : nullptr); @@ -88,7 +88,7 @@ } tree_expression * - tree_array_list::dup (symbol_table::scope&) const + tree_array_list::dup (symbol_scope&) const { panic_impossible (); return nullptr; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-array-list.h --- a/libinterp/parse-tree/pt-array-list.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-array-list.h Thu Nov 16 21:43:47 2017 -0500 @@ -77,9 +77,9 @@ void copy_base (const tree_array_list& array_list); void copy_base (const tree_array_list& array_list, - symbol_table::scope& scope); + symbol_scope& scope); - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw); }; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-assign.cc --- a/libinterp/parse-tree/pt-assign.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-assign.cc Thu Nov 16 21:43:47 2017 -0500 @@ -57,7 +57,7 @@ } tree_expression * - tree_simple_assignment::dup (symbol_table::scope& scope) const + tree_simple_assignment::dup (symbol_scope& scope) const { tree_simple_assignment *new_sa = new tree_simple_assignment (lhs ? lhs->dup (scope) : nullptr, @@ -92,7 +92,7 @@ } tree_expression * - tree_multi_assignment::dup (symbol_table::scope&) const + tree_multi_assignment::dup (symbol_scope&) const { panic_impossible (); return nullptr; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-assign.h --- a/libinterp/parse-tree/pt-assign.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-assign.h Thu Nov 16 21:43:47 2017 -0500 @@ -76,7 +76,7 @@ tree_expression * right_hand_side (void) { return rhs; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { @@ -141,7 +141,7 @@ tree_expression * right_hand_side (void) { return rhs; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-binop.cc --- a/libinterp/parse-tree/pt-binop.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-binop.cc Thu Nov 16 21:43:47 2017 -0500 @@ -50,7 +50,7 @@ } tree_expression * - tree_binary_expression::dup (symbol_table::scope& scope) const + tree_binary_expression::dup (symbol_scope& scope) const { tree_binary_expression *new_be = new tree_binary_expression (op_lhs ? op_lhs->dup (scope) : nullptr, @@ -87,7 +87,7 @@ } tree_expression * - tree_boolean_expression::dup (symbol_table::scope& scope) const + tree_boolean_expression::dup (symbol_scope& scope) const { tree_boolean_expression *new_be = new tree_boolean_expression (op_lhs ? op_lhs->dup (scope) : nullptr, diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-binop.h --- a/libinterp/parse-tree/pt-binop.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-binop.h Thu Nov 16 21:43:47 2017 -0500 @@ -103,7 +103,7 @@ return eligible_for_braindead_shortcircuit; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { @@ -170,7 +170,7 @@ type op_type (void) const { return etype; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-cell.cc --- a/libinterp/parse-tree/pt-cell.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-cell.cc Thu Nov 16 21:43:47 2017 -0500 @@ -37,7 +37,7 @@ namespace octave { tree_expression * - tree_cell::dup (symbol_table::scope& scope) const + tree_cell::dup (symbol_scope& scope) const { tree_cell *new_cell = new tree_cell (nullptr, line (), column ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-cell.h --- a/libinterp/parse-tree/pt-cell.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-cell.h Thu Nov 16 21:43:47 2017 -0500 @@ -60,7 +60,7 @@ bool rvalue_ok (void) const { return true; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-colon.cc --- a/libinterp/parse-tree/pt-colon.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-colon.cc Thu Nov 16 21:43:47 2017 -0500 @@ -31,7 +31,7 @@ // Colon expressions. tree_expression * - tree_colon_expression::dup (symbol_table::scope& scope) const + tree_colon_expression::dup (symbol_scope& scope) const { tree_colon_expression *new_ce = new tree_colon_expression (op_base ? op_base->dup (scope) : nullptr, diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-colon.h --- a/libinterp/parse-tree/pt-colon.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-colon.h Thu Nov 16 21:43:47 2017 -0500 @@ -90,7 +90,7 @@ tree_expression * increment (void) { return op_increment; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-const.cc --- a/libinterp/parse-tree/pt-const.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-const.cc Thu Nov 16 21:43:47 2017 -0500 @@ -58,7 +58,7 @@ } tree_expression * - tree_constant::dup (symbol_table::scope&) const + tree_constant::dup (symbol_scope&) const { tree_constant *new_tc = new tree_constant (val, orig_text, line (), column ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-const.h --- a/libinterp/parse-tree/pt-const.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-const.h Thu Nov 16 21:43:47 2017 -0500 @@ -78,7 +78,7 @@ octave_value value (void) { return val; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-decl.cc --- a/libinterp/parse-tree/pt-decl.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-decl.cc Thu Nov 16 21:43:47 2017 -0500 @@ -48,7 +48,7 @@ } tree_decl_elt * - tree_decl_elt::dup (symbol_table::scope& scope) const + tree_decl_elt::dup (symbol_scope& scope) const { return new tree_decl_elt (id ? id->dup (scope) : nullptr, expr ? expr->dup (scope) : nullptr); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-decl.h --- a/libinterp/parse-tree/pt-decl.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-decl.h Thu Nov 16 21:43:47 2017 -0500 @@ -94,7 +94,7 @@ tree_expression * expression (void) { return expr; } - tree_decl_elt * dup (symbol_table::scope& scope) const; + tree_decl_elt * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-eval.cc Thu Nov 16 21:43:47 2017 -0500 @@ -92,14 +92,14 @@ tree_parameter_list *param_list = anon_fh.parameter_list (); tree_expression *expr = anon_fh.expression (); - symbol_table::scope *af_scope = anon_fh.scope (); + symbol_scope *af_scope = anon_fh.scope (); symbol_table& symtab = m_interpreter.get_symbol_table (); - symbol_table::scope *af_parent_scope + symbol_scope *af_parent_scope = anon_fh.has_parent_scope () ? symtab.current_scope () : nullptr; - symbol_table::scope *new_scope = af_scope ? af_scope->dup () : nullptr; + symbol_scope *new_scope = af_scope ? af_scope->dup () : nullptr; if (new_scope && af_parent_scope) new_scope->inherit (af_parent_scope); @@ -618,7 +618,7 @@ return false; } - symbol_table::scope * + symbol_scope * tree_evaluator::get_current_scope (void) { symbol_table& symtab = m_interpreter.get_symbol_table (); @@ -968,7 +968,7 @@ // Make sure that any variable with the same name as the new // function is cleared. - symbol_table::scope *scope = symtab.current_scope (); + symbol_scope *scope = symtab.current_scope (); if (scope) scope->assign (nm); @@ -980,7 +980,7 @@ { octave_value_list retval; - symbol_table::symbol_record sym = expr.symbol (); + symbol_record sym = expr.symbol (); octave_value val = sym.find (); @@ -2658,7 +2658,7 @@ } else { - symbol_table::scope *scope + symbol_scope *scope = m_interpreter.require_current_scope ("tree_evaluator::bind_ans"); scope->force_assign (ans, val); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-eval.h --- a/libinterp/parse-tree/pt-eval.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-eval.h Thu Nov 16 21:43:47 2017 -0500 @@ -308,7 +308,7 @@ profiler& get_profiler (void) { return m_profiler; } - symbol_table::scope *get_current_scope (void); + symbol_scope *get_current_scope (void); int max_recursion_depth (void) const { return m_max_recursion_depth; } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-exp.h --- a/libinterp/parse-tree/pt-exp.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-exp.h Thu Nov 16 21:43:47 2017 -0500 @@ -58,7 +58,7 @@ virtual bool has_magic_end (void) const = 0; - virtual tree_expression * dup (symbol_table::scope& scope) const = 0; + virtual tree_expression * dup (symbol_scope& scope) const = 0; virtual bool is_constant (void) const { return false; } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-fcn-handle.cc --- a/libinterp/parse-tree/pt-fcn-handle.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-fcn-handle.cc Thu Nov 16 21:43:47 2017 -0500 @@ -46,7 +46,7 @@ } tree_expression * - tree_fcn_handle::dup (symbol_table::scope&) const + tree_fcn_handle::dup (symbol_scope&) const { tree_fcn_handle *new_fh = new tree_fcn_handle (nm, line (), column ()); @@ -63,18 +63,18 @@ } tree_expression * - tree_anon_fcn_handle::dup (symbol_table::scope&) const + tree_anon_fcn_handle::dup (symbol_scope&) const { tree_parameter_list *param_list = parameter_list (); tree_expression *expr = expression (); - symbol_table::scope *af_scope = m_scope; - symbol_table::scope *af_parent_scope = m_parent_scope; + symbol_scope *af_scope = m_scope; + symbol_scope *af_parent_scope = m_parent_scope; symbol_table& symtab = __get_symbol_table__ ("tree_anon_fcn_handle::dup"); - symbol_table::scope *new_scope = af_scope ? af_scope->dup () : nullptr; + symbol_scope *new_scope = af_scope ? af_scope->dup () : nullptr; // FIXME: why should we inherit from the current scope here? That // doesn't seem right, but with the way things work now it appears diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-fcn-handle.h --- a/libinterp/parse-tree/pt-fcn-handle.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-fcn-handle.h Thu Nov 16 21:43:47 2017 -0500 @@ -73,7 +73,7 @@ bool rvalue_ok (void) const { return true; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { @@ -97,8 +97,8 @@ { } tree_anon_fcn_handle (tree_parameter_list *pl, tree_expression *ex, - symbol_table::scope *scope, - symbol_table::scope *parent_scope, + symbol_scope *scope, + symbol_scope *parent_scope, int l = -1, int c = -1) : tree_expression (l, c), m_parameter_list (pl), m_expression (ex), m_scope (scope), m_parent_scope (parent_scope), m_file_name () @@ -123,13 +123,13 @@ tree_expression * expression (void) const { return m_expression; } - symbol_table::scope *scope (void) const { return m_scope; } + symbol_scope *scope (void) const { return m_scope; } - symbol_table::scope *parent_scope (void) const { return m_parent_scope; } + symbol_scope *parent_scope (void) const { return m_parent_scope; } bool has_parent_scope (void) const { return m_parent_scope; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { tw.visit_anon_fcn_handle (*this); } @@ -146,10 +146,10 @@ tree_expression *m_expression; // Function scope. - symbol_table::scope *m_scope; + symbol_scope *m_scope; // Parent scope, or 0 if none. - symbol_table::scope *m_parent_scope; + symbol_scope *m_parent_scope; // Filename where the handle was defined. std::string m_file_name; diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-funcall.cc --- a/libinterp/parse-tree/pt-funcall.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-funcall.cc Thu Nov 16 21:43:47 2017 -0500 @@ -68,7 +68,7 @@ } tree_funcall * - tree_funcall::dup (symbol_table::scope&) const + tree_funcall::dup (symbol_scope&) const { tree_funcall *new_fc = new tree_funcall (fcn, args, line (), column ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-funcall.h --- a/libinterp/parse-tree/pt-funcall.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-funcall.h Thu Nov 16 21:43:47 2017 -0500 @@ -66,7 +66,7 @@ void print_raw (std::ostream& os, bool pr_as_read_syntax = false, bool pr_orig_txt = true); - tree_funcall * dup (symbol_table::scope& scope) const; + tree_funcall * dup (symbol_scope& scope) const; octave_value function (void) const { return fcn; } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-id.cc --- a/libinterp/parse-tree/pt-id.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-id.cc Thu Nov 16 21:43:47 2017 -0500 @@ -67,12 +67,12 @@ } tree_identifier * - tree_identifier::dup (symbol_table::scope& scope) const + tree_identifier::dup (symbol_scope& scope) const { // The new tree_identifier object contains a symbol_record // entry from the duplicated scope. - symbol_table::symbol_record new_sym = scope.find_symbol (name ()); + symbol_record new_sym = scope.find_symbol (name ()); tree_identifier *new_id = new tree_identifier (new_sym, line (), column ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-id.h --- a/libinterp/parse-tree/pt-id.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-id.h Thu Nov 16 21:43:47 2017 -0500 @@ -53,7 +53,7 @@ tree_identifier (int l = -1, int c = -1) : tree_expression (l, c) { } - tree_identifier (const symbol_table::symbol_record& s, + tree_identifier (const symbol_record& s, int l = -1, int c = -1) : tree_expression (l, c), sym (s) { } @@ -121,14 +121,14 @@ name ().c_str ()); } - tree_identifier * dup (symbol_table::scope& scope) const; + tree_identifier * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { tw.visit_identifier (*this); } - symbol_table::symbol_record symbol (void) const + symbol_record symbol (void) const { return sym; } @@ -136,7 +136,7 @@ private: // The symbol record that this identifier references. - symbol_table::symbol_record sym; + symbol_record sym; }; class tree_black_hole : public tree_identifier @@ -152,7 +152,7 @@ bool is_black_hole (void) { return true; } - tree_black_hole * dup (symbol_table::scope&) const + tree_black_hole * dup (symbol_scope&) const { return new tree_black_hole; } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-idx.cc --- a/libinterp/parse-tree/pt-idx.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-idx.cc Thu Nov 16 21:43:47 2017 -0500 @@ -386,7 +386,7 @@ } tree_index_expression * - tree_index_expression::dup (symbol_table::scope& scope) const + tree_index_expression::dup (symbol_scope& scope) const { tree_index_expression *new_idx_expr = new tree_index_expression (line (), column ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-idx.h --- a/libinterp/parse-tree/pt-idx.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-idx.h Thu Nov 16 21:43:47 2017 -0500 @@ -94,7 +94,7 @@ octave_lvalue lvalue (tree_evaluator *tw); - tree_index_expression * dup (symbol_table::scope& scope) const; + tree_index_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-jit.cc --- a/libinterp/parse-tree/pt-jit.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-jit.cc Thu Nov 16 21:43:47 2017 -0500 @@ -1088,7 +1088,7 @@ } void - jit_convert::initialize (symbol_table::scope *s) + jit_convert::initialize (symbol_scope *s) { scope = s; iterator_count = 0; @@ -1136,7 +1136,7 @@ symbol_table& symtab = __get_symbol_table__ ("jit_convert::find_variable"); - symbol_table::symbol_record record = symtab.find_symbol (vname, scope); + symbol_record record = symtab.find_symbol (vname, scope); if (record.is_persistent () || record.is_global ()) throw jit_fail_exception ("Persistent and global not yet supported"); @@ -2803,7 +2803,7 @@ if (iter == extra_vars.end ()) { - symbol_table::scope *scope = __require_current_scope__ ("jit_convert::find"); + symbol_scope *scope = __require_current_scope__ ("jit_convert::find"); return scope->varval (vname); } diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-jit.h --- a/libinterp/parse-tree/pt-jit.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-jit.h Thu Nov 16 21:43:47 2017 -0500 @@ -179,7 +179,7 @@ bool converting_function; // the scope of the function we are converting, or the current scope - symbol_table::scope *scope; + symbol_scope *scope; jit_factory factory; @@ -204,7 +204,7 @@ variable_map vmap; - void initialize (symbol_table::scope *s); + void initialize (symbol_scope *s); jit_call * create_checked_impl (jit_call *ret); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-mat.cc --- a/libinterp/parse-tree/pt-mat.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-mat.cc Thu Nov 16 21:43:47 2017 -0500 @@ -122,7 +122,7 @@ } tree_expression * - tree_matrix::dup (symbol_table::scope& scope) const + tree_matrix::dup (symbol_scope& scope) const { tree_matrix *new_matrix = new tree_matrix (nullptr, line (), column ()); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-mat.h --- a/libinterp/parse-tree/pt-mat.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-mat.h Thu Nov 16 21:43:47 2017 -0500 @@ -63,7 +63,7 @@ bool rvalue_ok (void) const { return true; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-misc.cc --- a/libinterp/parse-tree/pt-misc.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-misc.cc Thu Nov 16 21:43:47 2017 -0500 @@ -77,7 +77,7 @@ } tree_parameter_list * - tree_parameter_list::dup (symbol_table::scope& scope) const + tree_parameter_list::dup (symbol_scope& scope) const { tree_parameter_list *new_list = new tree_parameter_list (); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-misc.h --- a/libinterp/parse-tree/pt-misc.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-misc.h Thu Nov 16 21:43:47 2017 -0500 @@ -80,7 +80,7 @@ std::list variable_names (void) const; - tree_parameter_list * dup (symbol_table::scope& scope) const; + tree_parameter_list * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-unop.cc --- a/libinterp/parse-tree/pt-unop.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-unop.cc Thu Nov 16 21:43:47 2017 -0500 @@ -40,7 +40,7 @@ // Prefix expressions. tree_expression * - tree_prefix_expression::dup (symbol_table::scope& scope) const + tree_prefix_expression::dup (symbol_scope& scope) const { tree_prefix_expression *new_pe = new tree_prefix_expression (op ? op->dup (scope) : nullptr, @@ -54,7 +54,7 @@ // Postfix expressions. tree_expression * - tree_postfix_expression::dup (symbol_table::scope& scope) const + tree_postfix_expression::dup (symbol_scope& scope) const { tree_postfix_expression *new_pe = new tree_postfix_expression (op ? op->dup (scope) : nullptr, diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/pt-unop.h --- a/libinterp/parse-tree/pt-unop.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/pt-unop.h Thu Nov 16 21:43:47 2017 -0500 @@ -105,7 +105,7 @@ bool rvalue_ok (void) const { return true; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { @@ -139,7 +139,7 @@ bool rvalue_ok (void) const { return true; } - tree_expression * dup (symbol_table::scope& scope) const; + tree_expression * dup (symbol_scope& scope) const; void accept (tree_walker& tw) { diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/token.cc --- a/libinterp/parse-tree/token.cc Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/token.cc Thu Nov 16 21:43:47 2017 -0500 @@ -67,7 +67,7 @@ m_orig_text () { } - token::token (int tv, const symbol_table::symbol_record& sr, int l, int c) + token::token (int tv, const symbol_record& sr, int l, int c) : m_maybe_cmd (false), m_tspc (false), m_line_num (l), m_column_num (c), m_tok_val (tv), m_type_tag (sym_rec_token), m_tok_info (sr), m_orig_text () @@ -126,7 +126,7 @@ return m_tok_info.m_et; } - symbol_table::symbol_record + symbol_record token::sym_rec (void) const { assert (m_type_tag == sym_rec_token); diff -r f494b87d2a93 -r bc3819b7cca1 libinterp/parse-tree/token.h --- a/libinterp/parse-tree/token.h Thu Nov 16 19:39:00 2017 -0500 +++ b/libinterp/parse-tree/token.h Thu Nov 16 21:43:47 2017 -0500 @@ -72,7 +72,7 @@ token (int tv, double d, const std::string& s = "", int l = -1, int c = -1); token (int tv, end_tok_type t, int l = -1, int c = -1); - token (int tv, const symbol_table::symbol_record& s, + token (int tv, const symbol_record& s, int l = -1, int c = -1); token (int tv, const std::string& mth, const std::string& cls, int l = -1, int c = -1); @@ -112,7 +112,7 @@ double number (void) const; token_type ttype (void) const; end_tok_type ettype (void) const; - symbol_table::symbol_record sym_rec (void) const; + symbol_record sym_rec (void) const; std::string superclass_method_name (void) const; std::string superclass_class_name (void) const; @@ -145,8 +145,8 @@ tok_info (end_tok_type et) : m_et (et) { } - tok_info (const symbol_table::symbol_record& sr) - : m_sr (new symbol_table::symbol_record (sr)) + tok_info (const symbol_record& sr) + : m_sr (new symbol_record (sr)) { } tok_info (const std::string& method_nm, const std::string& class_nm) @@ -165,7 +165,7 @@ end_tok_type m_et; - symbol_table::symbol_record *m_sr; + symbol_record *m_sr; struct superclass_info {