Mercurial > hg > octave-nkf
diff libinterp/parse-tree/pt-cell.cc @ 16237:70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
* pt-array-list.h, pt-array-list.cc: New files.
(tree_array_list): New class.
* pt-cell.h, pt-cell.cc (tree_cell): Derive from tree_array_list.
* pt-mat.h, pt-mat.cc (tree_matrix): Derive from tree_array_list.
* oct-parse.in.yy (octave_parser::finish_array_list): New function
adapted from octave_parser::finish_matrix.
(octave_parser::finish_matrix, octave_parser::finish_cell):
Call finish_array_list to do the work.
* pt-arg-list.h: Include symtab.h.
* base-list.h: Include cstdlib.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 09 Mar 2013 18:04:51 -0500 |
parents | 2fc554ffbc28 |
children | d63878346099 |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-cell.cc +++ b/libinterp/parse-tree/pt-cell.cc @@ -27,17 +27,12 @@ #include <iostream> #include "Cell.h" -#include "defun.h" -#include "error.h" #include "oct-obj.h" #include "pt-arg-list.h" -#include "pt-bp.h" #include "pt-exp.h" #include "pt-cell.h" #include "pt-walk.h" -#include "utils.h" #include "ov.h" -#include "variables.h" octave_value tree_cell::rvalue1 (int) @@ -107,14 +102,7 @@ { tree_cell *new_cell = new tree_cell (0, line (), column ()); - for (const_iterator p = begin (); p != end (); p++) - { - const tree_argument_list *elt = *p; - - new_cell->append (elt ? elt->dup (scope, context) : 0); - } - - new_cell->copy_base (*this); + new_cell->copy_base (*this, scope, context); return new_cell; }