Skip to content
Snippets Groups Projects
Commit 7ffbe324 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

macroprocessor: interpret arrays passed on the command line as arrays instead...

macroprocessor: interpret arrays passed on the command line as arrays instead of strings. closes #1578
parent 6876b0a7
Branches
No related tags found
No related merge requests found
/* /*
* Copyright (C) 2008-2017 Dynare Team * Copyright (C) 2008-2018 Dynare Team
* *
* This file is part of Dynare. * This file is part of Dynare.
* *
...@@ -60,6 +60,10 @@ MacroDriver::parse(const string &f, const string &fb, const string &modfiletxt, ...@@ -60,6 +60,10 @@ MacroDriver::parse(const string &f, const string &fb, const string &modfiletxt,
} }
catch (boost::bad_lexical_cast &) catch (boost::bad_lexical_cast &)
{ {
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 << "@#define " << it->first << " = \"" << it->second << "\"" << endl;
} }
file_with_endl << modfiletxt << endl; file_with_endl << modfiletxt << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment