Only use SourceReferenceFormatterHuman

This commit is contained in:
Alex Beregszaszi
2020-12-01 16:09:46 +01:00
committed by chriseth
parent 1126838a31
commit 1dedba8538
22 changed files with 47 additions and 41 deletions
+2 -2
View File
@@ -45,7 +45,7 @@
#include <liblangutil/ErrorReporter.h>
#include <liblangutil/Scanner.h>
#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/SourceReferenceFormatterHuman.h>
#include <boost/algorithm/string/replace.hpp>
@@ -460,7 +460,7 @@ void CompilerContext::appendInlineAssembly(
_assembly + "\n"
"------------------ Errors: ----------------\n";
for (auto const& error: errorReporter.errors())
message += SourceReferenceFormatter::formatErrorInformation(*error);
message += SourceReferenceFormatterHuman::formatErrorInformation(*error);
message += "-------------------------------------------\n";
solAssert(false, message);
+2 -2
View File
@@ -37,7 +37,7 @@
#include <libsolutil/Whiskers.h>
#include <libsolutil/StringUtils.h>
#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/SourceReferenceFormatterHuman.h>
#include <boost/range/adaptor/map.hpp>
@@ -60,7 +60,7 @@ pair<string, string> IRGenerator::run(
{
string errorMessage;
for (auto const& error: asmStack.errors())
errorMessage += langutil::SourceReferenceFormatter::formatErrorInformation(*error);
errorMessage += langutil::SourceReferenceFormatterHuman::formatErrorInformation(*error);
solAssert(false, ir + "\n\nInvalid IR generated:\n" + errorMessage + "\n");
}
asmStack.optimize();
+3 -2
View File
@@ -27,7 +27,7 @@
#include <libyul/AssemblyStack.h>
#include <libyul/Exceptions.h>
#include <libyul/optimiser/Suite.h>
#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/SourceReferenceFormatterHuman.h>
#include <libevmasm/Instruction.h>
#include <libsmtutil/Exceptions.h>
#include <libsolutil/JSON.h>
@@ -117,7 +117,8 @@ Json::Value formatErrorWithException(
)
{
string message;
string formattedMessage = SourceReferenceFormatter::formatExceptionInformation(_exception, _type);
// TODO: consider enabling color
string formattedMessage = SourceReferenceFormatterHuman::formatExceptionInformation(_exception, _type);
if (string const* description = boost::get_error_info<util::errinfo_comment>(_exception))
message = ((_message.length() > 0) ? (_message + ":") : "") + *description;