diff src/pt-select.cc @ 7767:71f068b22fcc

scope and context fixes for function handles
author John W. Eaton <jwe@octave.org>
date Wed, 07 May 2008 13:45:30 -0400
parents 745a8299c2b5
children 3100283874d7
line wrap: on
line diff
--- a/src/pt-select.cc
+++ b/src/pt-select.cc
@@ -60,10 +60,11 @@
 }
 
 tree_if_clause *
-tree_if_clause::dup (symbol_table::scope_id scope)
+tree_if_clause::dup (symbol_table::scope_id scope,
+		     symbol_table::context_id context)
 {
-  return new tree_if_clause (expr ? expr->dup (scope) : 0,
-			     list ? list->dup (scope) : 0,
+  return new tree_if_clause (expr ? expr->dup (scope, context) : 0,
+			     list ? list->dup (scope, context) : 0,
 			     lead_comm ? lead_comm->dup () : 0);
 }
 
@@ -88,7 +89,8 @@
 }
 
 tree_if_command_list *
-tree_if_command_list::dup (symbol_table::scope_id scope)
+tree_if_command_list::dup (symbol_table::scope_id scope,
+			   symbol_table::context_id context)
 {
   tree_if_command_list *new_icl = new tree_if_command_list ();
 
@@ -96,7 +98,7 @@
     {
       tree_if_clause *elt = *p;
 
-      new_icl->append (elt ? elt->dup (scope) : 0);
+      new_icl->append (elt ? elt->dup (scope, context) : 0);
     }
 
   return new_icl;
@@ -129,9 +131,10 @@
 }
 
 tree_command *
-tree_if_command::dup (symbol_table::scope_id scope)
+tree_if_command::dup (symbol_table::scope_id scope,
+		      symbol_table::context_id context)
 {
-  return new tree_if_command (list ? list->dup (scope) : 0,
+  return new tree_if_command (list ? list->dup (scope, context) : 0,
 			      lead_comm ? lead_comm->dup () : 0,
 			      trail_comm ? trail_comm->dup () : 0,
 			      line (), column ());
@@ -243,10 +246,11 @@
 }
 
 tree_switch_case *
-tree_switch_case::dup (symbol_table::scope_id scope)
+tree_switch_case::dup (symbol_table::scope_id scope,
+		       symbol_table::context_id context)
 {
-  return new tree_switch_case (label ? label->dup (scope) : 0,
-			       list ? list->dup (scope) : 0,
+  return new tree_switch_case (label ? label->dup (scope, context) : 0,
+			       list ? list->dup (scope, context) : 0,
 			       lead_comm ? lead_comm->dup () : 0);
 }
 
@@ -271,7 +275,8 @@
 }
 
 tree_switch_case_list *
-tree_switch_case_list::dup (symbol_table::scope_id scope)
+tree_switch_case_list::dup (symbol_table::scope_id scope,
+			    symbol_table::context_id context)
 {
   tree_switch_case_list *new_scl = new tree_switch_case_list ();
 
@@ -279,7 +284,7 @@
     {
       tree_switch_case *elt = *p;
 
-      new_scl->append (elt ? elt->dup (scope) : 0);
+      new_scl->append (elt ? elt->dup (scope, context) : 0);
     }
   
   return new_scl;
@@ -332,10 +337,11 @@
 }
 
 tree_command *
-tree_switch_command::dup (symbol_table::scope_id scope)
+tree_switch_command::dup (symbol_table::scope_id scope,
+			  symbol_table::context_id context)
 {
-  return new tree_switch_command (expr ? expr->dup (scope) : 0,
-				  list ? list->dup (scope) : 0,
+  return new tree_switch_command (expr ? expr->dup (scope, context) : 0,
+				  list ? list->dup (scope, context) : 0,
 				  lead_comm ? lead_comm->dup () : 0,
 				  trail_comm ? trail_comm->dup () : 0,
 				  line (), column ());