SourceReferenceFormatter: Support full range of options in formatErrorInformation()

This commit is contained in:
Kamil Śliwak
2023-08-11 14:15:56 +02:00
parent b7d2c8bb0a
commit 8407c8c615
4 changed files with 35 additions and 27 deletions
+7 -10
View File
@@ -1486,16 +1486,13 @@ void CompilerStack::generateIR(ContractDefinition const& _contract)
m_optimiserSettings,
m_debugInfoSelection
);
if (!stack.parseAndAnalyze("", compiledContract.yulIR))
{
string errorMessage;
for (auto const& error: stack.errors())
errorMessage += langutil::SourceReferenceFormatter::formatErrorInformation(
*error,
stack.charStream("")
);
solAssert(false, compiledContract.yulIR + "\n\nInvalid IR generated:\n" + errorMessage + "\n");
}
bool yulAnalysisSuccessful = stack.parseAndAnalyze("", compiledContract.yulIR);
solAssert(
yulAnalysisSuccessful,
compiledContract.yulIR + "\n\n"
"Invalid IR generated:\n" +
langutil::SourceReferenceFormatter::formatErrorInformation(stack.errors(), stack) + "\n"
);
compiledContract.yulIRAst = stack.astJson();
stack.optimize();