StatementFlow class
Defined in module l0_check_flow (l0_check_flow.py).
Statement traversal and loop-liveness fixed points as one recursive algorithm.
Public static attributes
- static TypeCompatibility compat
- static ExpressionInference expr
- static ExpressionLiveness liveness
- static SemanticLookup lookup
- static PatternAnalysis patterns
- static CheckerState state
Protected functions
- auto _check_function(self, FunctionEnv func_env, FuncType func_type) -> None
- Check a single function definition.
- auto _check_dead_liveness_block(self, Block block, *bool check_return_paths) -> StmtFlow
- Type-check an unreachable branch without exporting liveness or loop exits.
- auto _check_update_from_backedge_states(self, Stmt|None update, list]] states[list[dict[str, bool]) -> list[list[dict[str, bool]]]
- Check a for-update statement from all reachable body backedges.
- auto _check_loop_iteration(self, Block body, *Stmt|None update = None, bool check_return_paths = False) -> tuple[LoopFlowCapture, list[list[dict[str, bool]]], StmtFlow]
- Check one loop iteration and return captured flow states.
- auto _loop_liveness_fixed_point(self, list] pre_loop[dict[str, bool], Block body, *Expr|None cond = None, Stmt|None update = None) -> tuple[list[dict[str, bool]], LoopFlowCapture, list[list[dict[str, bool]]]]
- Converge loop-head liveness and diagnose later-iteration uses.
- auto _check_block(self, Block block, *bool check_return_paths = False, bool push_new_scope = True) -> StmtFlow
- Check a block of statements.
- auto _check_stmt(self, Stmt stmt, *bool check_return_paths = False) -> StmtFlow
- Check a single statement.
- auto _check_return(self, ReturnStmt stmt) -> None
- Check return statement validity and type compatibility.
Function documentation
None l0_check_flow:: StatementFlow:: _check_function(self,
FunctionEnv func_env,
FuncType func_type) protected
Check a single function definition.
| Parameters | |
|---|---|
| func_env | The function's environment containing AST and module info. |
| func_type | The function's resolved signature. |
StmtFlow l0_check_flow:: StatementFlow:: _check_block(self,
Block block,
*bool check_return_paths = False,
bool push_new_scope = True) protected
Check a block of statements.
| Parameters | |
|---|---|
| block | The Block node. |
| check_return_paths | Whether to track return paths in this block. |
| push_new_scope | Whether to push a new lexical scope for this block. |
StmtFlow l0_check_flow:: StatementFlow:: _check_stmt(self,
Stmt stmt,
*bool check_return_paths = False) protected
Check a single statement.
| Parameters | |
|---|---|
| stmt | The Stmt node. |
| check_return_paths | Whether to update return path tracking. |