(func_id, block_nodes)
| 615 | defaults=[]) |
| 616 | |
| 617 | def 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 | |
| 637 | def generateFunctionStatement(func_node, traced, lineno): |
| 638 | nameIdentifier = func_node['childSets']['identifier'][0]['properties']['identifier'] |
no test coverage detected