diff libinterp/parse-tree/pt-cell.cc @ 23075:4e3d47dc7e25

move parse tree classes inside octave namespace * lex.h, lex.ll, oct-parse.in.yy, parse.h, pt-all.h, pt-arg-list.cc, pt-arg-list.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h, pt-binop.cc, pt-binop.h, pt-bp.cc, pt-bp.h, pt-cbinop.cc, pt-cbinop.h, pt.cc, pt-cell.cc, pt-cell.h, pt-check.cc, pt-check.h, pt-classdef.cc, pt-classdef.h, pt-cmd.cc, pt-cmd.h, pt-colon.cc, pt-colon.h, pt-const.cc, pt-const.h, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc, pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-funcall.cc, pt-funcall.h, pt.h, pt-id.cc, pt-id.h, pt-idx.cc, pt-idx.h, pt-jump.cc, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-mat.h, pt-misc.cc, pt-misc.h, pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-stmt.cc, pt-stmt.h, pt-unop.cc, pt-unop.h, pt-walk.h, token.cc, token.h: Move classes and most functions inside octave namespace. Change all uses.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Jan 2017 23:41:54 -0500
parents 551ac93c984c
children ef4d915df748
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-cell.cc	Thu Jan 19 14:47:19 2017 -0500
+++ b/libinterp/parse-tree/pt-cell.cc	Thu Jan 19 23:41:54 2017 -0500
@@ -34,80 +34,82 @@
 #include "pt-walk.h"
 #include "ov.h"
 
-octave_value
-tree_cell::rvalue1 (int)
+namespace octave
 {
-  octave_value retval;
-
-  octave_idx_type nr = length ();
-  octave_idx_type nc = -1;
+  octave_value
+  tree_cell::rvalue1 (int)
+  {
+    octave_value retval;
 
-  Cell val;
+    octave_idx_type nr = length ();
+    octave_idx_type nc = -1;
 
-  octave_idx_type i = 0;
+    Cell val;
 
-  for (tree_argument_list* elt : *this)
-    {
-      octave_value_list row = elt->convert_to_const_vector ();
+    octave_idx_type i = 0;
+
+    for (tree_argument_list* elt : *this)
+      {
+        octave_value_list row = elt->convert_to_const_vector ();
 
-      if (nr == 1)
-        // Optimize the single row case.
-        val = row.cell_value ();
-      else if (nc < 0)
-        {
-          nc = row.length ();
+        if (nr == 1)
+          // Optimize the single row case.
+          val = row.cell_value ();
+        else if (nc < 0)
+          {
+            nc = row.length ();
 
-          val = Cell (nr, nc);
-        }
-      else
-        {
-          octave_idx_type this_nc = row.length ();
+            val = Cell (nr, nc);
+          }
+        else
+          {
+            octave_idx_type this_nc = row.length ();
 
-          if (this_nc != nc)
-            {
-              if (this_nc == 0)
-                continue;  // blank line
-              else
-                error ("number of columns must match");
-            }
-        }
+            if (this_nc != nc)
+              {
+                if (this_nc == 0)
+                  continue;  // blank line
+                else
+                  error ("number of columns must match");
+              }
+          }
 
-      for (octave_idx_type j = 0; j < nc; j++)
-        val(i,j) = row(j);
+        for (octave_idx_type j = 0; j < nc; j++)
+          val(i,j) = row(j);
 
-      i++;
-    }
+        i++;
+      }
 
-  if (i < nr)
-    val.resize (dim_vector (i, nc));  // there were blank rows
-  retval = val;
+    if (i < nr)
+      val.resize (dim_vector (i, nc));  // there were blank rows
+    retval = val;
 
-  return retval;
-}
+    return retval;
+  }
 
-octave_value_list
-tree_cell::rvalue (int nargout)
-{
-  if (nargout > 1)
-    error ("invalid number of output arguments for cell array");
+  octave_value_list
+  tree_cell::rvalue (int nargout)
+  {
+    if (nargout > 1)
+      error ("invalid number of output arguments for cell array");
 
-  return rvalue1 (nargout);
-}
+    return rvalue1 (nargout);
+  }
 
-tree_expression *
-tree_cell::dup (symbol_table::scope_id scope,
-                symbol_table::context_id context) const
-{
-  tree_cell *new_cell = new tree_cell (0, line (), column ());
+  tree_expression *
+  tree_cell::dup (symbol_table::scope_id scope,
+                  symbol_table::context_id context) const
+  {
+    tree_cell *new_cell = new tree_cell (0, line (), column ());
 
-  new_cell->copy_base (*this, scope, context);
+    new_cell->copy_base (*this, scope, context);
 
-  return new_cell;
-}
+    return new_cell;
+  }
 
-void
-tree_cell::accept (tree_walker& tw)
-{
-  tw.visit_cell (*this);
+  void
+  tree_cell::accept (tree_walker& tw)
+  {
+    tw.visit_cell (*this);
+  }
 }
-