Fixed bug introduced in 985d7423.

If a float smaller than one in absolute value is written without a
leading zero in the mod file, for instance as `.5`, we really need to
prefix the number with a zero. The simplest approach is to convert
the strings representing the numerical constants into floats.

(cherry picked from commit 2479a2a7)
parent f6558212
Pipeline #3011 passed with stages
in 3 minutes and 2 seconds
......@@ -458,7 +458,7 @@ void
NumConstNode::writeJsonAST(ostream &output) const
{
output << R"({"node_type" : "NumConstNode", "value" : )";
output << datatree.num_constants.get(id) << "}";
output << std::stof(datatree.num_constants.get(id)) << "}";
}
void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment