From 58a8693989039f2a8ec13a95e8b20f62eea0863f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 5 Jun 2020 15:00:39 +0200 Subject: [PATCH] JSON output: do not append two underscores after model local variable names in their definition This is inconsistent with the way they are printed in equations (without underscores). The practice of appending underscores only makes sense in a MATLAB workspace context. (cherry picked from commit f9ab44da56558ae4be891ad97e52b637484551f6) --- src/ModelTree.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ModelTree.cc b/src/ModelTree.cc index 08d38348..a8348e7a 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -1653,10 +1653,8 @@ ModelTree::writeJsonModelLocalVariables(ostream &output, deriv_node_temp_terms_t if (!efout.empty()) output << ", "; - /* We append underscores to avoid name clashes with "g1" or "oo_" (see - also VariableNode::writeOutput) */ - output << R"({"variable": ")" << symbol_table.getName(id) << R"(__")" - << R"(, "value": ")"; + output << R"({"variable": ")" << symbol_table.getName(id) + << R"(", "value": ")"; value->writeJsonOutput(output, tt, tef_terms); output << R"("})" << endl; } -- GitLab