JSON: fix output of date options

They were not enclosed within quotes.

Ref. dynare#1875
master
Sébastien Villemot 2022-12-14 12:15:13 +01:00
parent 2758f46c83
commit a5eac0260a
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 2 deletions

View File

@ -278,11 +278,11 @@ OptionsList::writeJsonOutput(ostream &output) const
output << R"(")" << name << R"(": )";
std::visit([&]<class T>(const T &v)
{
if constexpr(is_same_v<T, NumVal> || is_same_v<T, DateVal>)
if constexpr(is_same_v<T, NumVal>)
output << v;
else if constexpr(is_same_v<T, pair<string, string>>)
output << '[' << v.first << ", " << v.second << ']';
else if constexpr(is_same_v<T, StringVal>)
else if constexpr(is_same_v<T, StringVal> || is_same_v<T, DateVal>)
output << '"' << v << '"';
else if constexpr(is_same_v<T, SymbolListVal>)
{