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

Function generateTracedFunctionBlock

python/executor.py:617–635  ·  view source on GitHub ↗
(func_id, block_nodes)

Source from the content-addressed store, hash-verified

615 defaults=[])
616
617def generateTracedFunctionBlock(func_id, block_nodes):
618 key = ast.Name(id=SPLOOT_KEY, ctx=ast.Load())
619 func = ast.Attribute(
620 value=key, attr="func", ctx=ast.Load()
621 )
622 args = [
623 ast.Constant(func_id)
624 ]
625 constructor = ast.Call(func, args, keywords=[])
626 assign_node = ast.Assign([ast.Name('t', ast.Store())], constructor)
627 traced_statements = getStatementsFromBlock(block_nodes, True)
628 statements = getStatementsFromBlock(block_nodes, False)
629
630 cap_expr = ast.Attribute(value=ast.Name('t', ast.Load()), attr="cap", ctx=ast.Load())
631 if_node = ast.If(cap_expr, traced_statements, statements)
632
633 with_node = ast.With([ast.withitem(ast.Name('t', ast.Load()))], [if_node])
634
635 return [assign_node, with_node]
636
637def generateFunctionStatement(func_node, traced, lineno):
638 nameIdentifier = func_node['childSets']['identifier'][0]['properties']['identifier']

Callers 1

Calls 1

getStatementsFromBlockFunction · 0.70

Tested by

no test coverage detected