mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Minor refactor.
This commit is contained in:
parent
079a9ab1f0
commit
eeaf9b4e20
@ -417,7 +417,7 @@ string AssignmentStmtGenerator::visit()
|
|||||||
exprGen.resetNestingDepth();
|
exprGen.resetNestingDepth();
|
||||||
if (!lhs.has_value())
|
if (!lhs.has_value())
|
||||||
return "\n";
|
return "\n";
|
||||||
auto rhs = exprGen.rOrLValueExpression(lhs.value());
|
auto rhs = exprGen.rLValueOrLiteral(lhs.value());
|
||||||
exprGen.resetNestingDepth();
|
exprGen.resetNestingDepth();
|
||||||
if (!rhs.has_value())
|
if (!rhs.has_value())
|
||||||
return "\n";
|
return "\n";
|
||||||
@ -430,7 +430,7 @@ string ExpressionStmtGenerator::visit()
|
|||||||
ExpressionGenerator exprGen{state};
|
ExpressionGenerator exprGen{state};
|
||||||
auto randomType = TypeProvider{state}.type();
|
auto randomType = TypeProvider{state}.type();
|
||||||
pair<SolidityTypePtr, string> randomTypeName = {randomType, {}};
|
pair<SolidityTypePtr, string> randomTypeName = {randomType, {}};
|
||||||
auto expression = exprGen.rOrLValueExpression(randomTypeName);
|
auto expression = exprGen.rLValueOrLiteral(randomTypeName);
|
||||||
if (expression.has_value())
|
if (expression.has_value())
|
||||||
return indentation() + expression.value().second + ";\n";
|
return indentation() + expression.value().second + ";\n";
|
||||||
else
|
else
|
||||||
@ -1323,7 +1323,7 @@ optional<string> FunctionCallGenerator::rhs(vector<pair<SolidityTypePtr, string>
|
|||||||
auto inputArguments = _functionInputTypeNames |
|
auto inputArguments = _functionInputTypeNames |
|
||||||
ranges::views::transform([&exprGen](auto& _item) -> pair<bool, optional<pair<SolidityTypePtr, string>>>
|
ranges::views::transform([&exprGen](auto& _item) -> pair<bool, optional<pair<SolidityTypePtr, string>>>
|
||||||
{
|
{
|
||||||
auto e = exprGen.rOrLValueExpression(_item);
|
auto e = exprGen.rLValueOrLiteral(_item);
|
||||||
exprGen.resetNestingDepth();
|
exprGen.resetNestingDepth();
|
||||||
if (e.has_value())
|
if (e.has_value())
|
||||||
return {true, e.value()};
|
return {true, e.value()};
|
||||||
|
Loading…
Reference in New Issue
Block a user