Simple tuple expressions.

This commit is contained in:
chriseth 2019-05-02 18:28:33 +02:00
parent c604481cef
commit f68c09272b
2 changed files with 16 additions and 0 deletions

View File

@ -131,6 +131,21 @@ bool IRGeneratorForStatements::visit(Assignment const& _assignment)
return false; return false;
} }
bool IRGeneratorForStatements::visit(TupleExpression const& _tuple)
{
if (_tuple.isInlineArray())
solUnimplementedAssert(false, "");
else
{
solUnimplementedAssert(!_tuple.annotation().lValueRequested, "");
solUnimplementedAssert(_tuple.components().size() == 1, "");
solAssert(_tuple.components().front(), "");
_tuple.components().front()->accept(*this);
defineExpression(_tuple) << m_context.variable(*_tuple.components().front()) << "\n";
}
return false;
}
bool IRGeneratorForStatements::visit(ForStatement const& _for) bool IRGeneratorForStatements::visit(ForStatement const& _for)
{ {
m_code << "for {\n"; m_code << "for {\n";

View File

@ -47,6 +47,7 @@ public:
void endVisit(VariableDeclarationStatement const& _variableDeclaration) override; void endVisit(VariableDeclarationStatement const& _variableDeclaration) override;
bool visit(Assignment const& _assignment) override; bool visit(Assignment const& _assignment) override;
bool visit(TupleExpression const& _tuple) override;
bool visit(ForStatement const& _forStatement) override; bool visit(ForStatement const& _forStatement) override;
bool visit(Continue const& _continueStatement) override; bool visit(Continue const& _continueStatement) override;
bool visit(Break const& _breakStatement) override; bool visit(Break const& _breakStatement) override;