Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
16683:e1c6ad54259f | 16684:edbb123cbe3a |
---|---|
2785 { return map2Cell (package_map); } | 2785 { return map2Cell (package_map); } |
2786 | 2786 |
2787 octave_value | 2787 octave_value |
2788 cdef_package::cdef_package_rep::find (const std::string& nm) | 2788 cdef_package::cdef_package_rep::find (const std::string& nm) |
2789 { | 2789 { |
2790 if (scope == -1) | 2790 std::string symbol_name = get_name () + "." + nm; |
2791 scope = symbol_table::alloc_package_scope (get_name ()); | 2791 |
2792 | 2792 return symbol_table::find (symbol_name, octave_value_list (), true, false); |
2793 return symbol_table::find (nm, octave_value_list (), true, false, scope); | |
2794 } | 2793 } |
2795 | 2794 |
2796 octave_value_list | 2795 octave_value_list |
2797 cdef_package::cdef_package_rep::meta_subsref | 2796 cdef_package::cdef_package_rep::meta_subsref |
2798 (const std::string& type, const std::list<octave_value_list>& idx, | 2797 (const std::string& type, const std::list<octave_value_list>& idx, |