Add new JSON API for better abstraction and for supporting strict JSON parsing

This commit is contained in:
Alexander Arlt
2018-02-20 21:58:26 +01:00
committed by Alex Beregszaszi
parent dcc4083b23
commit 0f29ac4e56
15 changed files with 337 additions and 53 deletions
+3 -4
View File
@@ -554,12 +554,11 @@ Json::Value StandardCompiler::compile(Json::Value const& _input)
string StandardCompiler::compile(string const& _input)
{
Json::Value input;
Json::Reader reader;
string errors;
try
{
if (!reader.parse(_input, input, false))
return jsonCompactPrint(formatFatalError("JSONError", reader.getFormattedErrorMessages()));
if (!jsonParseStrict(_input, input, &errors))
return jsonCompactPrint(formatFatalError("JSONError", errors));
}
catch(...)
{