Skip to content

wake.ir.yul.continue_statement module #

YulContinue class #

Bases: YulStatementAbc

Continue statement can be used in a body of a YulForLoop to skip the rest of the loop body and continue with the next iteration.

Example

assembly {
    for { let i := 0 } lt(i, 10) { i := add(i, 1) } {
        // ...
        continue
    }
}
Source code in wake/ir/yul/continue_statement.py
class YulContinue(YulStatementAbc):
    """
    Continue statement can be used in a body of a [YulForLoop][wake.ir.yul.for_loop.YulForLoop] to skip the rest of the loop body and continue with the next iteration.

    !!! example
        ```solidity
        assembly {
            for { let i := 0 } lt(i, 10) { i := add(i, 1) } {
                // ...
                continue
            }
        }
        ```
    """

    _parent: weakref.ReferenceType[YulBlock]

    @property
    def parent(self) -> YulBlock:
        """
        Returns:
            Parent IR node.
        """
        return super().parent

    @property
    def modifies_state(
        self,
    ) -> Set[Tuple[Union[ExpressionAbc, StatementAbc, YulAbc], ModifiesStateFlag]]:
        return set()

parent: YulBlock property #

Returns:

Type Description
YulBlock

Parent IR node.