mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add support for do/while loops
This commit adds support for a standard do <statement> while <expr>; form of statement. While loops were already being supported; supporting a do/while loop mostly involves reusing code from while loops but putting the conditional checking last.
This commit is contained in:
@@ -264,7 +264,11 @@ bool ASTJsonConverter::visit(IfStatement const& _node)
|
||||
|
||||
bool ASTJsonConverter::visit(WhileStatement const& _node)
|
||||
{
|
||||
addJsonNode(_node, "WhileStatement", {}, true);
|
||||
addJsonNode(
|
||||
_node,
|
||||
_node.isDoWhile() ? "DoWhileStatement" : "WhileStatement",
|
||||
{},
|
||||
true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user