Merge remote-tracking branch 'origin/develop' into merge_develop_060

This commit is contained in:
Leonardo Alt
2019-11-20 12:27:40 +01:00
104 changed files with 621 additions and 653 deletions
+8 -8
View File
@@ -90,7 +90,7 @@ string AsmPrinter::operator()(Identifier const& _identifier) const
string AsmPrinter::operator()(ExpressionStatement const& _statement) const
{
return boost::apply_visitor(*this, _statement.expression);
return std::visit(*this, _statement.expression);
}
string AsmPrinter::operator()(Assignment const& _assignment) const
@@ -99,7 +99,7 @@ string AsmPrinter::operator()(Assignment const& _assignment) const
string variables = (*this)(_assignment.variableNames.front());
for (size_t i = 1; i < _assignment.variableNames.size(); ++i)
variables += ", " + (*this)(_assignment.variableNames[i]);
return variables + " := " + boost::apply_visitor(*this, *_assignment.value);
return variables + " := " + std::visit(*this, *_assignment.value);
}
string AsmPrinter::operator()(VariableDeclaration const& _variableDeclaration) const
@@ -114,7 +114,7 @@ string AsmPrinter::operator()(VariableDeclaration const& _variableDeclaration) c
if (_variableDeclaration.value)
{
out += " := ";
out += boost::apply_visitor(*this, *_variableDeclaration.value);
out += std::visit(*this, *_variableDeclaration.value);
}
return out;
}
@@ -149,7 +149,7 @@ string AsmPrinter::operator()(FunctionCall const& _functionCall) const
return
(*this)(_functionCall.functionName) + "(" +
boost::algorithm::join(
_functionCall.arguments | boost::adaptors::transformed(boost::apply_visitor(*this)),
_functionCall.arguments | boost::adaptors::transformed([&](auto&& _node) { return std::visit(*this, _node); }),
", " ) +
")";
}
@@ -161,13 +161,13 @@ string AsmPrinter::operator()(If const& _if) const
char delim = '\n';
if (body.find('\n') == string::npos)
delim = ' ';
return "if " + boost::apply_visitor(*this, *_if.condition) + delim + (*this)(_if.body);
return "if " + std::visit(*this, *_if.condition) + delim + (*this)(_if.body);
}
string AsmPrinter::operator()(Switch const& _switch) const
{
solAssert(_switch.expression, "Invalid expression pointer.");
string out = "switch " + boost::apply_visitor(*this, *_switch.expression);
string out = "switch " + std::visit(*this, *_switch.expression);
for (auto const& _case: _switch.cases)
{
if (!_case.value)
@@ -183,7 +183,7 @@ string AsmPrinter::operator()(ForLoop const& _forLoop) const
{
solAssert(_forLoop.condition, "Invalid for loop condition.");
string pre = (*this)(_forLoop.pre);
string condition = boost::apply_visitor(*this, *_forLoop.condition);
string condition = std::visit(*this, *_forLoop.condition);
string post = (*this)(_forLoop.post);
char delim = '\n';
if (
@@ -217,7 +217,7 @@ string AsmPrinter::operator()(Block const& _block) const
if (_block.statements.empty())
return "{ }";
string body = boost::algorithm::join(
_block.statements | boost::adaptors::transformed(boost::apply_visitor(*this)),
_block.statements | boost::adaptors::transformed([&](auto&& _node) { return std::visit(*this, _node); }),
"\n"
);
if (body.size() < 30 && body.find('\n') == string::npos)