diff libinterp/octave-value/ov-classdef.cc @ 16684:edbb123cbe3a classdef

Correct handling of package context in symbol table. This change partially revert the previous changes on the symbol table, because the function table is not a member of the symbol table, but a static field. * libinterp/interpfcn/load-path.h (load_path::do_find_method, load_path::do_methods): Remove methods. (load_path::find_method, load_path::methods): Reimplement with class load_path::loader. * libinterp/interpfcn/load-path.cc (load_path::do_find_method, load_path::do_methods): Remove methods. * libinterp/interpfcn/symtab.h (symbol_table::package_name): Remove field, moved to symbol_table::fcn_info::fcn_info_rep. Suppress all usage. (symbol_table::find): Remove scope argument. (symbol_table::alloc_package_scope): Remove method. (symbol_table::fcn_info::find_function, symbol_table::fcn_info::find_user_function, symbol_table::fcn_info::find): Remove package_name argument. (symbol_table::fcn_info::fcn_info_rep::find, symbol_table::fcn_info::fcn_info_rep::xfind, symbol_table::fcn_info::fcn_info_rep::find_function, symbol_table::fcn_info::fcn_info_rep::find_user_function, symbol_table::fcn_info::fcn_info_rep::find_package, symbol_table::fcn_info::fcn_info_rep::load_class_constructor): Likewise. (symbol_table::fcn_info::fcn_info_rep::package_name): New member. (symbol_table::fcn_info::fcn_info_rep::fcn_info_rep): Initialize it. (symbol_table::fcn_info::fcn_info_rep::full_name): New method. * libinterp/interpfcn/symtab.cc (symbol_table::fcn_info::fcn_info_rep::load_class_constructor, symbol_table::fcn_info::fcn_info_rep::find, symbol_table::fcn_info::fcn_info_rep::xfind, symbol_table::fcn_info::fcn_info_rep::find_package, symbol_table::fcn_info::fcn_info_rep::find_user_function): Remove package_name argument. Use package_name member instead. (symbol_table::fcn_info::fcn_info_rep::load_class_method): Simplify, using full_name method and package_name member. (symbol_table::fcn_info::fcn_info_rep::dump): Use full_name. (symbol_table::find): Remove scope argument. (symbol_table::do_find): Do not use (removed) package_name member. * libinterp/octave-value/ov-classdef.h (cdef_package::cdef_package_rep::scope): Remove member. Suppress all usages. * libinterp/octave-value/ov-classdef.cc (cdef_package::cdef_package_rep::find): Do not use (removed) scope member. Pass fully-qualified name to the symbol table.
author Michael Goffioul <michael.goffioul@gmail.com>
date Sat, 18 May 2013 23:12:56 -0400
parents 7368654f302f
children 04e110438873
line wrap: on
line diff
--- a/libinterp/octave-value/ov-classdef.cc	Sat May 18 22:43:10 2013 -0400
+++ b/libinterp/octave-value/ov-classdef.cc	Sat May 18 23:12:56 2013 -0400
@@ -2787,10 +2787,9 @@
 octave_value
 cdef_package::cdef_package_rep::find (const std::string& nm)
 {
-  if (scope == -1)
-    scope = symbol_table::alloc_package_scope (get_name ());
-
-  return symbol_table::find (nm, octave_value_list (), true, false, scope);
+  std::string symbol_name = get_name () + "." + nm;
+
+  return symbol_table::find (symbol_name, octave_value_list (), true, false);
 }
 
 octave_value_list