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:
@@ -2,14 +2,14 @@
|
||||
Expressions and Control Structures
|
||||
##################################
|
||||
|
||||
.. index:: if, else, while, for, break, continue, return, switch, goto
|
||||
.. index:: if, else, while, do/while, for, break, continue, return, switch, goto
|
||||
|
||||
Control Structures
|
||||
===================
|
||||
|
||||
Most of the control structures from C or JavaScript are available in Solidity
|
||||
except for ``switch`` and ``goto``. So
|
||||
there is: ``if``, ``else``, ``while``, ``for``, ``break``, ``continue``, ``return``, ``? :``, with
|
||||
there is: ``if``, ``else``, ``while``, ``do``, ``for``, ``break``, ``continue``, ``return``, ``? :``, with
|
||||
the usual semantics known from C or JavaScript.
|
||||
|
||||
Parentheses can *not* be omitted for conditionals, but curly brances can be omitted
|
||||
|
||||
Reference in New Issue
Block a user