From 781039752aa8852d59ee043e2aa68fd7564dcf03 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Thu, 16 Apr 2015 17:13:19 +0200
Subject: [PATCH] preprocessor: take care of instruments option in
 discretionary_policy

squash
---
 ComputingTasks.cc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/ComputingTasks.cc b/ComputingTasks.cc
index d7d11787..5070ae5a 100644
--- a/ComputingTasks.cc
+++ b/ComputingTasks.cc
@@ -490,7 +490,8 @@ DiscretionaryPolicyStatement::checkPass(ModFileStructure &mod_file_struct, Warni
 Statement *
 DiscretionaryPolicyStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
 {
-  SymbolList new_symbol_list;
+  SymbolList new_symbol_list, new_options_symbol_list;
+  OptionsList new_options_list = options_list;
   try
     {
       SymbolTable *new_symbol_table =  dynamic_datatree.getSymbolTable();
@@ -500,6 +501,18 @@ DiscretionaryPolicyStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree,
           new_symbol_table->getID(*it);
           new_symbol_list.addSymbol(*it);
         }
+
+      OptionsList::symbol_list_options_t::const_iterator it = options_list.symbol_list_options.find("instruments");
+      if (it != options_list.symbol_list_options.end())
+        {
+          symbols = it->second.get_symbols();
+          for (vector<string>::const_iterator it1 = symbols.begin(); it1 != symbols.end(); it1++)
+            {
+              new_symbol_table->getID(*it1);
+              new_options_symbol_list.addSymbol(*it1);
+            }
+          new_options_list.symbol_list_options["instruments"] = new_options_symbol_list;
+        }
     }
   catch (...)
     {
-- 
GitLab