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

Function generateReturnStatement

python/executor.py:652–666  ·  view source on GitHub ↗
(return_node, traced, lineno)

Source from the content-addressed store, hash-verified

650
651
652def generateReturnStatement(return_node, traced, lineno):
653 ret_expr = generateAstExpression(return_node['childSets']['value'][0])
654 if ret_expr is None:
655 ret_expr = ast.Constant(None)
656
657 if not traced:
658 return [ast.Return(ret_expr, lineno=lineno)]
659
660 key = ast.Name(id=SPLOOT_KEY, ctx=ast.Load())
661 func = ast.Attribute(value=key, attr="logExpressionResult", ctx=ast.Load())
662 args = [ast.Constant("PYTHON_RETURN"), ast.Dict([], []), ret_expr]
663 wrapped = ast.Call(func, args=args, keywords=[])
664 return [
665 ast.Return(wrapped, lineno=lineno)
666 ]
667
668def generateBreakStatement(node, traced, lineno):
669 if not traced:

Callers 1

Calls 1

generateAstExpressionFunction · 0.70

Tested by

no test coverage detected