Skip to content

wake.ir.statements.continue_statement module #

Continue class #

Bases: StatementAbc

Example

continue in the following code:

function foo() public {
    for (uint i = 0; i < 10; i++) {
        if (i == 5)
            continue;
    }
}

Source code in wake/ir/statements/continue_statement.py
class Continue(StatementAbc):
    """
    !!! example
        `:::solidity continue` in the following code:
        ```solidity
        function foo() public {
            for (uint i = 0; i < 10; i++) {
                if (i == 5)
                    continue;
            }
        }
        ```
    """

    _ast_node: SolcContinue
    _parent: weakref.ReferenceType[
        Union[
            Block,
            DoWhileStatement,
            ForStatement,
            IfStatement,
            UncheckedBlock,
            WhileStatement,
        ]
    ]

    def __init__(self, init: IrInitTuple, continue_: SolcContinue, parent: SolidityAbc):
        super().__init__(init, continue_, parent)

    @property
    def parent(
        self,
    ) -> Union[
        Block,
        DoWhileStatement,
        ForStatement,
        IfStatement,
        UncheckedBlock,
        WhileStatement,
    ]:
        """
        Returns:
            Parent IR node.
        """
        return super().parent

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

parent: Union[Block, DoWhileStatement, ForStatement, IfStatement, UncheckedBlock, WhileStatement] property #

Returns:

Type Description
Union[Block, DoWhileStatement, ForStatement, IfStatement, UncheckedBlock, WhileStatement]

Parent IR node.