Skip to main content

Module stmts

Module stmts 

Source
Expand description

Statement-shape probes over Solar HIR.

Structsยง

StmtVisitor ๐Ÿ”’
Runs f on every statement (pre-order, nested ones included) until it breaks.

Functionsยง

branch_always_exits
True when executing stmt provably prevents control from continuing past it: return, revert, selfdestruct, require(false, ..) / assert(false), a block containing any such statement, an if whose both arms exit, a try whose every clause exits, or a do-while whose body exits without break/continue.
count_placeholders
Number of _ placeholders in stmts, recursing into nested control flow.
count_placeholders_in_stmt ๐Ÿ”’
do_while_user_stmts
Strips the trailing if (cond) break; that lowers do { ... } while (cond);.
is_break_stmt
break, possibly wrapped in single-statement blocks.
is_loop_termination_if
if (...) break; as synthesized by the do-while lowering.
loop_stmts
The statements of one loop iteration: the body followed by the for update, if any.
loop_update
The for update statement of a loop, which runs after every iteration.
modifier_prefix
The statements a modifier runs before its unique _;, when that placeholder is reached unconditionally. None for non-modifiers, bodiless modifiers and conditional placeholders.
stmt_expr
The expression directly owned by stmt (nested statements excluded).
stmts_before_placeholder
Collects the statements executed before the first placeholder of a modifier body, following nested blocks. Returns None when the placeholder is not reached unconditionally (e.g. it is inside an if, loop or try).
stmts_break_or_continue
break/continue targeting the current loop (nested loops shadow them).
visit_stmts
Runs f on every statement of stmts and their nested statements (pre-order) until it breaks.