Provide formal version in json output.

This commit is contained in:
chriseth
2016-07-18 18:26:56 +02:00
parent 417fde3eab
commit 9a9a815fc9
3 changed files with 22 additions and 3 deletions
+16
View File
@@ -219,6 +219,22 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback
output["contracts"][contractName] = contractData;
}
// Do not taint the internal error list
ErrorList formalErrors;
if (compiler.prepareFormalAnalysis(&formalErrors))
output["formal"]["why3"] = compiler.formalTranslation();
if (!formalErrors.empty())
{
Json::Value errors(Json::arrayValue);
for (auto const& error: formalErrors)
errors.append(formatError(
*error,
(error->type() == Error::Type::Warning) ? "Warning" : "Error",
scannerFromSourceName
));
output["formal"]["errors"] = errors;
}
output["sources"] = Json::Value(Json::objectValue);
for (auto const& source: _sources)
{