Replace boost:lexical_cast<std::string> for std::to_string.

This commit is contained in:
Matías Aereal Aeón 2018-08-08 03:55:43 -03:00
parent 009a55c82d
commit 7dae58cbcc
4 changed files with 11 additions and 11 deletions

View File

@ -43,7 +43,7 @@ string Exception::lineInfo() const
ret += *file; ret += *file;
ret += ':'; ret += ':';
if (line) if (line)
ret += boost::lexical_cast<string>(*line); ret += std::to_string(*line);
return ret; return ret;
} }

View File

@ -85,7 +85,7 @@ bool AsmAnalyzer::operator()(assembly::Literal const& _literal)
{ {
m_errorReporter.typeError( m_errorReporter.typeError(
_literal.location, _literal.location,
"String literal too long (" + boost::lexical_cast<std::string>(_literal.value.size()) + " > 32)" "String literal too long (" + std::to_string(_literal.value.size()) + " > 32)"
); );
return false; return false;
} }
@ -185,7 +185,7 @@ bool AsmAnalyzer::operator()(assembly::ExpressionStatement const& _statement)
Error::Type errorType = m_flavour == AsmFlavour::Loose ? *m_errorTypeForLoose : Error::Type::TypeError; Error::Type errorType = m_flavour == AsmFlavour::Loose ? *m_errorTypeForLoose : Error::Type::TypeError;
string msg = string msg =
"Top-level expressions are not supposed to return values (this expression returns " + "Top-level expressions are not supposed to return values (this expression returns " +
boost::lexical_cast<string>(m_stackHeight - initialStackHeight) + std::to_string(m_stackHeight - initialStackHeight) +
" value" + " value" +
(m_stackHeight - initialStackHeight == 1 ? "" : "s") + (m_stackHeight - initialStackHeight == 1 ? "" : "s") +
"). Use ``pop()`` or assign them."; "). Use ``pop()`` or assign them.";
@ -322,8 +322,8 @@ bool AsmAnalyzer::operator()(assembly::FunctionCall const& _funCall)
{ {
m_errorReporter.typeError( m_errorReporter.typeError(
_funCall.functionName.location, _funCall.functionName.location,
"Expected " + boost::lexical_cast<string>(arguments) + " arguments but got " + "Expected " + std::to_string(arguments) + " arguments but got " +
boost::lexical_cast<string>(_funCall.arguments.size()) + "." std::to_string(_funCall.arguments.size()) + "."
); );
success = false; success = false;
} }
@ -477,7 +477,7 @@ bool AsmAnalyzer::expectDeposit(int _deposit, int _oldHeight, SourceLocation con
m_errorReporter.typeError( m_errorReporter.typeError(
_location, _location,
"Expected expression to return one item to the stack, but did return " + "Expected expression to return one item to the stack, but did return " +
boost::lexical_cast<string>(m_stackHeight - _oldHeight) + std::to_string(m_stackHeight - _oldHeight) +
" items." " items."
); );
return false; return false;

View File

@ -279,7 +279,7 @@ assembly::Expression Parser::parseExpression()
"Expected '(' (instruction \"" + "Expected '(' (instruction \"" +
instructionNames().at(instr.instruction) + instructionNames().at(instr.instruction) +
"\" expects " + "\" expects " +
boost::lexical_cast<string>(args) + std::to_string(args) +
" arguments)" " arguments)"
)); ));
} }
@ -502,7 +502,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
"Expected expression (instruction \"" + "Expected expression (instruction \"" +
instructionNames().at(instr) + instructionNames().at(instr) +
"\" expects " + "\" expects " +
boost::lexical_cast<string>(args) + std::to_string(args) +
" arguments)" " arguments)"
)); ));
@ -514,7 +514,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
"Expected ',' (instruction \"" + "Expected ',' (instruction \"" +
instructionNames().at(instr) + instructionNames().at(instr) +
"\" expects " + "\" expects " +
boost::lexical_cast<string>(args) + std::to_string(args) +
" arguments)" " arguments)"
)); ));
else else
@ -527,7 +527,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
"Expected ')' (instruction \"" + "Expected ')' (instruction \"" +
instructionNames().at(instr) + instructionNames().at(instr) +
"\" expects " + "\" expects " +
boost::lexical_cast<string>(args) + std::to_string(args) +
" arguments)" " arguments)"
)); ));
expectToken(Token::RParen); expectToken(Token::RParen);

View File

@ -117,7 +117,7 @@ public:
if (occurrences > 32) if (occurrences > 32)
{ {
infos.resize(32); infos.resize(32);
_message += " Truncated from " + boost::lexical_cast<std::string>(occurrences) + " to the first 32 occurrences."; _message += " Truncated from " + std::to_string(occurrences) + " to the first 32 occurrences.";
} }
} }