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

Function generateFunctionStatement

python/text_generator.py:392–399  ·  view source on GitHub ↗
(func_node)

Source from the content-addressed store, hash-verified

390 defaults=[])
391
392def generateFunctionStatement(func_node):
393 nameIdentifier = func_node['childSets']['identifier'][0]['properties']['identifier']
394 statements = getStatementsFromBlock(func_node["childSets"]["body"])
395 decorators = []
396 if 'decorators' in func_node['childSets']:
397 decorators = [generateAstExpression(dec['childSets']['expression'][0]) for dec in func_node['childSets']['decorators']]
398 funcArgs = generateFunctionArguments(func_node['childSets']['params'])
399 return [ast.FunctionDef(nameIdentifier, funcArgs, statements, decorators)]
400
401
402def generateReturnStatement(return_node):

Callers 1

generateAstStatementFunction · 0.70

Calls 3

getStatementsFromBlockFunction · 0.70
generateAstExpressionFunction · 0.70

Tested by

no test coverage detected