MCPcopy Create free account
hub / github.com/SplootCode/splootcode / getStatementsFromBlock

Function getStatementsFromBlock

python/text_generator.py:289–299  ·  view source on GitHub ↗
(blockChildSet, insert_pass=True)

Source from the content-addressed store, hash-verified

287
288
289def 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
302def generateIfStatementFromElif(elif_node, else_nodes):

Callers 7

generateElseStatementFunction · 0.70
generateIfStatementFunction · 0.70
generateForStatementFunction · 0.70
generateWhileStatementFunction · 0.70
convertSplootToTextFunction · 0.70

Calls 1

generateAstStatementFunction · 0.70

Tested by

no test coverage detected