From 9cb1e4c07ae730d8a2de6a1a60c1f1f9b237e6a5 Mon Sep 17 00:00:00 2001
From: sebastien <sebastien@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Mon, 3 Nov 2008 16:35:40 +0000
Subject: [PATCH] trunk preprocessor: fixed bug when both "simul" and "periods"
 options are given to stoch_simul

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2232 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 ParsingDriver.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ParsingDriver.cc b/ParsingDriver.cc
index dcd1b6d3..c0f2dc53 100644
--- a/ParsingDriver.cc
+++ b/ParsingDriver.cc
@@ -617,8 +617,9 @@ ParsingDriver::option_num(const string &name_option, string *opt)
 void
 ParsingDriver::option_num(const string &name_option, const string &opt)
 {
-  if (options_list.num_options.find(name_option)
-      != options_list.num_options.end())
+  // Since "periods" option automatically sets "simul" option, we don't want to fail if user explicitly sets both "simul" and "periods"
+  if (name_option != "simul"
+      && (options_list.num_options.find(name_option) != options_list.num_options.end()))
     error("option " + name_option + " declared twice");
 
   if ((name_option == "periods") && (mod_file->model_tree.mode == eSparseDLLMode || mod_file->model_tree.mode == eSparseMode))
-- 
GitLab