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

Function generateAstStatementContents

python/executor.py:695–727  ·  view source on GitHub ↗
(sploot_node, traced, lineno)

Source from the content-addressed store, hash-verified

693 return None
694
695def generateAstStatementContents(sploot_node, traced, lineno):
696 if sploot_node["type"] == "PYTHON_STATEMENT":
697 if len(sploot_node['childSets']['statement']) != 0:
698 return generateAstStatement(sploot_node['childSets']['statement'][0], traced)
699 return None
700 elif sploot_node["type"] == "PYTHON_EXPRESSION":
701 exp = generateAstExpressionStatement(sploot_node, traced, lineno)
702 return [exp]
703 elif sploot_node["type"] == "PYTHON_IMPORT":
704 return generateImportStatement(sploot_node, traced, lineno)
705 elif sploot_node["type"] == "PYTHON_FROM_IMPORT":
706 return generateFromImportStatement(sploot_node, traced, lineno)
707 elif sploot_node["type"] == "PYTHON_ASSIGNMENT":
708 return [generateAssignmentStatement(sploot_node, traced, lineno),]
709 elif sploot_node["type"] == "PYTHON_IF_STATEMENT":
710 return generateIfStatement(sploot_node, traced, lineno)
711 elif sploot_node["type"] == "PYTHON_WHILE_LOOP":
712 return generateWhileStatement(sploot_node, traced, lineno)
713 elif sploot_node["type"] == "PYTHON_FOR_LOOP":
714 return generateForStatement(sploot_node, traced, lineno)
715 elif sploot_node["type"] == "PYTHON_FUNCTION_DECLARATION":
716 return generateFunctionStatement(sploot_node, traced, lineno)
717 elif sploot_node["type"] == "PYTHON_RETURN":
718 return generateReturnStatement(sploot_node, traced, lineno)
719 elif sploot_node["type"] == "PY_BREAK":
720 return generateBreakStatement(sploot_node, traced, lineno)
721 elif sploot_node["type"] == "PY_CONTINUE":
722 return generateContinueStatement(sploot_node, traced, lineno)
723 elif sploot_node["type"] == "PY_COMMENT":
724 return None
725 else:
726 print("Error: Unrecognised statement type: ", sploot_node["type"])
727 return None
728
729
730class CaptureContext:

Callers 1

generateAstStatementFunction · 0.85

Calls 12

generateAstStatementFunction · 0.70
generateImportStatementFunction · 0.70
generateIfStatementFunction · 0.70
generateWhileStatementFunction · 0.70
generateForStatementFunction · 0.70
generateReturnStatementFunction · 0.70
generateBreakStatementFunction · 0.70

Tested by

no test coverage detected