Support Why3 in StandardCompiler

This commit is contained in:
Alex Beregszaszi 2017-04-11 09:43:30 +01:00
parent b513db74a0
commit aa0776d5e8

View File

@ -337,6 +337,30 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
} }
output["contracts"] = contractsOutput; output["contracts"] = contractsOutput;
{
ErrorList formalErrors;
if (m_compilerStack.prepareFormalAnalysis(&formalErrors))
output["why3"] = m_compilerStack.formalTranslation();
for (auto const& error: formalErrors)
{
auto err = dynamic_pointer_cast<Error const>(error);
errors.append(formatErrorWithException(
*error,
err->type() == Error::Type::Warning,
err->typeName(),
"general",
"",
scannerFromSourceName
));
}
// FIXME!!
if (!formalErrors.empty())
output["errors"] = errors;
}
return output; return output;
} }