Mercurial > hg > octave-lyh
changeset 12130:3229572cbe23
symbol_table::parent_classes: also add parents of parents to the list
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 22 Jan 2011 12:55:18 -0500 |
parents | 80fc70a53400 |
children | da9afc5c4cfb |
files | src/ChangeLog src/symtab.h |
diffstat | 2 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-22 John W. Eaton <jwe@octave.org> + + * symtab.h (symbol_table::parent_classes): + Also add parents of parents to the list. Bug #32210. + 2011-01-22 Jaroslav Hajek <highegg@gmail.com> * ov-class.cc (octave_class::subsasgn): Find appropriate unique base
--- a/src/symtab.h +++ b/src/symtab.h @@ -1866,6 +1866,19 @@ if (it != parent_map.end ()) retval = it->second; + for (std::list<std::string>::const_iterator lit = retval.begin (); + lit != retval.end (); lit++) + { + // Search for parents of parents and append them to the list. + + // FIXME -- should we worry about a circular inheritance graph? + + std::list<std::string> parents = parent_classes (*lit); + + if (! parents.empty ()) + retval.insert (retval.end (), parents.begin (), parents.end ()); + } + return retval; }