(while_node, traced, lineno)
| 574 | |
| 575 | |
| 576 | def generateWhileStatement(while_node, traced, lineno): |
| 577 | condition = generateAstExpression(while_node["childSets"]["condition"][0]) |
| 578 | |
| 579 | if traced: |
| 580 | key = ast.Name(id=SPLOOT_KEY, ctx=ast.Load()) |
| 581 | func = ast.Attribute( |
| 582 | value=key, attr="logExpressionResultAndStartFrame", ctx=ast.Load() |
| 583 | ) |
| 584 | args = [ |
| 585 | ast.Constant("PYTHON_WHILE_LOOP_ITERATION"), |
| 586 | ast.Constant("condition"), |
| 587 | condition, |
| 588 | ] |
| 589 | condition = ast.Call(func, args=args, keywords=[]) |
| 590 | |
| 591 | statements = getStatementsFromBlock(while_node["childSets"]["block"], traced) |
| 592 | if not traced: |
| 593 | return statements |
| 594 | |
| 595 | statements.insert(0, startChildSetStatement('block')) |
| 596 | statements.append(endFrame()) |
| 597 | |
| 598 | return [ |
| 599 | startFrameStatement('PYTHON_WHILE_LOOP', 'frames'), |
| 600 | ast.While(condition, statements, [], lineno=lineno), |
| 601 | endLoop(), |
| 602 | endFrame() |
| 603 | ] |
| 604 | |
| 605 | def generateFunctionArguments(arg_list): |
| 606 | args = [] |
no test coverage detected