<s> """<STR_LIT>""" <EOL> from nuitka . nodes . AssignNodes import ( <EOL> ExpressionTargetTempVariableRef , <EOL> ExpressionTempVariableRef , <EOL> StatementAssignmentVariable , <EOL> StatementReleaseVariable <EOL> ) <EOL> from nuitka . nodes . BuiltinIteratorNodes import ( <EOL> ExpressionAsyncIter , <EOL> ExpressionAsyncNext , <EOL> ExpressionBuiltinIter1 , <EOL> ExpressionBuiltinNext1 <EOL> ) <EOL> from nuitka . nodes . ComparisonNodes import ExpressionComparisonIs <EOL> from nuitka . nodes . ConditionalNodes import StatementConditional <EOL> from nuitka . nodes . ConstantRefNodes import ExpressionConstantRef <EOL> from nuitka . nodes . LoopNodes import StatementLoop , StatementLoopBreak <EOL> from nuitka . nodes . StatementNodes import StatementsSequence <EOL> from . Helpers import ( <EOL> buildNode , <EOL> buildStatementsNode , <EOL> makeStatementsSequence , <EOL> makeStatementsSequenceFromStatements , <EOL> popBuildContext , <EOL> pushBuildContext <EOL> ) <EOL> from . ReformulationAssignmentStatements import buildAssignmentStatements <EOL> from . ReformulationTryExceptStatements import makeTryExceptSingleHandlerNode <EOL> from . ReformulationTryFinallyStatements import makeTryFinallyStatement <EOL> def _buildForLoopNode ( provider , node , sync , source_ref ) : <EOL> source = buildNode ( provider , node . iter , source_ref ) <EOL> temp_scope = provider . allocateTempScope ( "<STR_LIT>" ) <EOL> tmp_iter_variable = provider . allocateTempVariable ( <EOL> temp_scope = temp_scope , <EOL> name = "<STR_LIT>" <EOL> ) <EOL> tmp_value_variable = provider . allocateTempVariable ( <EOL> temp_scope = temp_scope , <EOL> name = "<STR_LIT>" <EOL> ) <EOL> else_block = buildStatementsNode ( <EOL> provider = provider , <EOL> nodes = node . orelse if node . orelse else None , <EOL> source_ref = source_ref <EOL> ) <EOL> if else_block is not None : <EOL> tmp_break_indicator = provider . allocateTempVariable ( <EOL> temp_scope = temp_scope , <EOL> name = "<STR_LIT>" <EOL> ) <EOL> statements = [ <EOL> StatementAssignmentVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = tmp_break_indicator , <EOL> source_ref = source_ref <EOL> ) , <EOL> source = ExpressionConstantRef ( <EOL> constant = True , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ] <EOL> else : <EOL> statements = [ ] <EOL> statements . append ( <EOL> StatementLoopBreak ( <EOL> source_ref = source_ref <EOL> ) <EOL> ) <EOL> handler_body = makeStatementsSequence ( <EOL> statements = statements , <EOL> allow_none = False , <EOL> source_ref = source_ref <EOL> ) <EOL> if sync : <EOL> next_node = ExpressionBuiltinNext1 ( <EOL> value = ExpressionTempVariableRef ( <EOL> variable = tmp_iter_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> else : <EOL> next_node = ExpressionAsyncNext ( <EOL> value = ExpressionTempVariableRef ( <EOL> variable = tmp_iter_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> statements = ( <EOL> makeTryExceptSingleHandlerNode ( <EOL> tried = StatementAssignmentVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = tmp_value_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source = next_node , <EOL> source_ref = source_ref <EOL> ) , <EOL> exception_name = "<STR_LIT>" if sync else "<STR_LIT>" , <EOL> handler_body = handler_body , <EOL> source_ref = source_ref <EOL> ) , <EOL> buildAssignmentStatements ( <EOL> provider = provider , <EOL> node = node . target , <EOL> source = ExpressionTempVariableRef ( <EOL> variable = tmp_value_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ) <EOL> pushBuildContext ( "<STR_LIT>" ) <EOL> statements += ( <EOL> buildStatementsNode ( <EOL> provider = provider , <EOL> nodes = node . body , <EOL> source_ref = source_ref <EOL> ) , <EOL> ) <EOL> popBuildContext ( ) <EOL> loop_body = makeStatementsSequence ( <EOL> statements = statements , <EOL> allow_none = True , <EOL> source_ref = source_ref <EOL> ) <EOL> cleanup_statements = [ <EOL> StatementReleaseVariable ( <EOL> variable = tmp_value_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> StatementReleaseVariable ( <EOL> variable = tmp_iter_variable , <EOL> source_ref = source_ref <EOL> ) <EOL> ] <EOL> if else_block is not None : <EOL> statements = [ <EOL> StatementAssignmentVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = tmp_break_indicator , <EOL> source_ref = source_ref <EOL> ) , <EOL> source = ExpressionConstantRef ( <EOL> constant = False , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ] <EOL> else : <EOL> statements = [ ] <EOL> if sync : <EOL> iter_source = ExpressionBuiltinIter1 ( <EOL> value = source , <EOL> source_ref = source . getSourceReference ( ) <EOL> ) <EOL> else : <EOL> iter_source = ExpressionAsyncIter ( <EOL> value = source , <EOL> source_ref = source . getSourceReference ( ) <EOL> ) <EOL> statements += [ <EOL> StatementAssignmentVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = tmp_iter_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source = iter_source , <EOL> source_ref = source_ref <EOL> ) , <EOL> makeTryFinallyStatement ( <EOL> provider = provider , <EOL> tried = StatementLoop ( <EOL> body = loop_body , <EOL> source_ref = source_ref <EOL> ) , <EOL> final = StatementsSequence ( <EOL> statements = cleanup_statements , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ] <EOL> if else_block is not None : <EOL> statements += [ <EOL> StatementConditional ( <EOL> condition = ExpressionComparisonIs ( <EOL> left = ExpressionTempVariableRef ( <EOL> variable = tmp_break_indicator , <EOL> source_ref = source_ref <EOL> ) , <EOL> right = ExpressionConstantRef ( <EOL> constant = True , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> yes_branch = else_block , <EOL> no_branch = None , <EOL> source_ref = source_ref <EOL> ) <EOL> ] <EOL> statements = ( <EOL> makeTryFinallyStatement ( <EOL> provider = provider , <EOL> tried = statements , <EOL> final = StatementReleaseVariable ( <EOL> variable = tmp_break_indicator , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> ) <EOL> return makeStatementsSequenceFromStatements ( <EOL> * statements <EOL> ) <EOL> def buildForLoopNode ( provider , node , source_ref ) : <EOL> return _buildForLoopNode ( provider , node , True , source_ref ) <EOL> def buildAsyncForLoopNode ( provider , node , source_ref ) : <EOL> return _buildForLoopNode ( provider , node , False , source_ref ) </s>
