Пример #1
0
bool Why3Translator::visit(Return const& _node)
{
	addSourceFromDocStrings(_node.annotation());

	if (_node.expression())
	{
		solAssert(!!_node.annotation().functionReturnParameters, "");
		auto const& params = _node.annotation().functionReturnParameters->parameters();
		if (params.size() != 1)
		{
			error(_node, "Directly returning tuples not supported. Rather assign to return variable.");
			return false;
		}
		add("begin _" + params.front()->name() + " := ");
		_node.expression()->accept(*this);
		add("; raise Return end");
	}
	else
		add("raise Return");
	return false;
}
bool ReferencesResolver::visit(Return const& _return)
{
    _return.annotation().functionReturnParameters = m_returnParameters;
    return true;
}