From 7ffbe32445d2537d5f2db564d9661ebc78f140bc Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 23 Jan 2018 16:31:33 +0100
Subject: [PATCH] macroprocessor: interpret arrays passed on the command line
 as arrays instead of strings. closes #1578

---
 macro/MacroDriver.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/macro/MacroDriver.cc b/macro/MacroDriver.cc
index bd15152b..446a9a9e 100644
--- a/macro/MacroDriver.cc
+++ b/macro/MacroDriver.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2017 Dynare Team
+ * Copyright (C) 2008-2018 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -60,7 +60,11 @@ MacroDriver::parse(const string &f, const string &fb, const string &modfiletxt,
       }
     catch (boost::bad_lexical_cast &)
       {
-        file_with_endl << "@#define " << it->first << " = \"" << it->second << "\"" << endl;
+        if (it->second.front() == '[' && it->second.back() == ']')
+          // If the input is an array. Issue #1578
+          file_with_endl << "@#define " << it->first << " = " << it->second << endl;
+        else
+          file_with_endl << "@#define " << it->first << " = \"" << it->second << "\"" << endl;
       }
   file_with_endl << modfiletxt << endl;
 
-- 
GitLab