Fix commit reverted in 4d89452e1bb6cc55f0800d6cbf976f2519f822c1.

issue#70
Houtan Bastani 2018-01-25 00:47:50 +01:00
parent 8bae11e85a
commit 46fbd8107c
1 changed files with 6 additions and 2 deletions

View File

@ -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.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 << modfiletxt << endl;