From bcb829fda73586dfea2b153a6da7e88d4b96864e Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Thu, 25 Jan 2018 00:47:50 +0100 Subject: [PATCH] Fix commit reverted in 4d89452e1bb6cc55f0800d6cbf976f2519f822c1. (cherry picked from commit 3a6227387b497d90d00a117777020ad0191c0988) --- preprocessor/macro/MacroDriver.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/preprocessor/macro/MacroDriver.cc b/preprocessor/macro/MacroDriver.cc index 71d53b9cb..69a2699e0 100644 --- a/preprocessor/macro/MacroDriver.cc +++ b/preprocessor/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. * @@ -64,7 +64,11 @@ MacroDriver::parse(const string &f, ostream &out, bool debug, bool no_line_macro } catch (boost::bad_lexical_cast &) { - file_with_endl << "@#define " << it->first << " = \"" << it->second << "\"" << endl; + if (!it->second.empty() && it->second.at(0) == '[' && it->second.at(it->second.length()-1) == ']') + // 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 << in.rdbuf() << endl; -- GitLab