Skip to content
Snippets Groups Projects
Verified Commit a5eac026 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

JSON: fix output of date options

They were not enclosed within quotes.

Ref. dynare#1875
parent 2758f46c
No related branches found
No related tags found
No related merge requests found
...@@ -278,11 +278,11 @@ OptionsList::writeJsonOutput(ostream &output) const ...@@ -278,11 +278,11 @@ OptionsList::writeJsonOutput(ostream &output) const
output << R"(")" << name << R"(": )"; output << R"(")" << name << R"(": )";
std::visit([&]<class T>(const T &v) 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; output << v;
else if constexpr(is_same_v<T, pair<string, string>>) else if constexpr(is_same_v<T, pair<string, string>>)
output << '[' << v.first << ", " << v.second << ']'; 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 << '"'; output << '"' << v << '"';
else if constexpr(is_same_v<T, SymbolListVal>) else if constexpr(is_same_v<T, SymbolListVal>)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment