(blockChildSet, insert_pass=True)
| 287 | |
| 288 | |
| 289 | def getStatementsFromBlock(blockChildSet, insert_pass=True): |
| 290 | statements = [] |
| 291 | for node in blockChildSet: |
| 292 | new_statements = generateAstStatement(node) |
| 293 | if new_statements: |
| 294 | statements.extend(new_statements) |
| 295 | |
| 296 | # If all nodes in this block are comments, add a pass statement |
| 297 | if insert_pass and not any(not isinstance(s, ast_comments.Comment) for s in statements): |
| 298 | statements.append(ast.Pass()) |
| 299 | return statements |
| 300 | |
| 301 | |
| 302 | def generateIfStatementFromElif(elif_node, else_nodes): |
no test coverage detected