Adds fmtlib as 3rdparty dependency for easier string composition.

This commit is contained in:
Christian Parpart
2021-10-11 13:35:08 +02:00
parent 16c4a889a6
commit 3f08b2269a
12 changed files with 64 additions and 24 deletions
+10 -14
View File
@@ -37,6 +37,8 @@
#include <boost/algorithm/string.hpp>
#include <fmt/format.h>
#include <memory>
#include <functional>
@@ -643,7 +645,7 @@ void AsmAnalyzer::expectValidType(YulString _type, SourceLocation const& _locati
m_errorReporter.typeError(
5473_error,
_location,
"\"" + _type.str() + "\" is not a valid type (user defined types are not yet supported)."
fmt::format("\"{}\" is not a valid type (user defined types are not yet supported).", _type)
);
}
@@ -653,11 +655,7 @@ void AsmAnalyzer::expectType(YulString _expectedType, YulString _givenType, Sour
m_errorReporter.typeError(
3781_error,
_location,
"Expected a value of type \"" +
_expectedType.str() +
"\" but got \"" +
_givenType.str() +
"\""
fmt::format("Expected a value of type \"{}\" but got \"{}\".", _expectedType, _givenType)
);
}
@@ -689,14 +687,12 @@ bool AsmAnalyzer::validateInstructions(evmasm::Instruction _instr, SourceLocatio
m_errorReporter.typeError(
_errorId,
_location,
"The \"" +
boost::to_lower_copy(instructionInfo(_instr).name)
+ "\" instruction is " +
vmKindMessage +
" VMs " +
"(you are currently compiling for \"" +
m_evmVersion.name() +
"\")."
fmt::format(
"The \"{instruction}\" instruction is {kind} VMs (you are currently compiling for \"{version}\").",
fmt::arg("instruction", boost::to_lower_copy(instructionInfo(_instr).name)),
fmt::arg("kind", vmKindMessage),
fmt::arg("version", m_evmVersion.name())
)
);
};