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

Function generateFunction

python/convert_ast.py:277–283  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

275 return [SplootNode('PY_IDENTIFIER', {}, {'identifier': a.arg}) for a in arguments.args]
276
277def generateFunction(func):
278 return SplootNode('PYTHON_FUNCTION_DECLARATION', {
279 'decorators': [SplootNode('PY_DECORATOR', {'expression': [generateExpression(d)]}) for d in func.decorator_list],
280 'identifier': [SplootNode('PY_IDENTIFIER', {}, {'identifier': func.name})],
281 'params': generateArgs(func.args),
282 'body': getBlockBodyFromStatements(func.body),
283 }, {'id': None})
284
285def generateSplootStatement(statement):
286 global lineno

Callers 1

generateSplootStatementFunction · 0.85

Calls 4

generateExpressionFunction · 0.85
SplootNodeFunction · 0.70
generateArgsFunction · 0.70

Tested by

no test coverage detected