Grows the graph by adding a jump node. Jump nodes are added to the current leaf set, and the leaf set becomes empty. If the jump node is the last in a cond section, then it may be added back to the leaf set by a separate mechanism. Args: ast_node: ast.AST guards: Tuple[
(self, ast_node, guards)
| 380 | return node |
| 381 | |
| 382 | def _add_jump_node(self, ast_node, guards): |
| 383 | """Grows the graph by adding a jump node. |
| 384 | |
| 385 | Jump nodes are added to the current leaf set, and the leaf set becomes |
| 386 | empty. If the jump node is the last in a cond section, then it may be added |
| 387 | back to the leaf set by a separate mechanism. |
| 388 | |
| 389 | Args: |
| 390 | ast_node: ast.AST |
| 391 | guards: Tuple[ast.AST, ...], the finally sections active for this node |
| 392 | Returns: |
| 393 | Node |
| 394 | """ |
| 395 | node = self._add_new_node(ast_node) |
| 396 | self.leaves = set() |
| 397 | # The guards themselves may not yet be complete, and will be wired later. |
| 398 | self.finally_sections[node] = guards |
| 399 | return node |
| 400 | |
| 401 | def _connect_jump_to_finally_sections(self, node): |
| 402 | """Connects a jump node to the finally sections protecting it.""" |
no test coverage detected