#NEWLINE# def generateTryNextExceptStopIterationCode( statement , emit , context ) : #NEWLINE# #INDENT# except_handler = statement . getBlockExceptHandler ( ) #NEWLINE# if ( except_handler is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( statement . getBlockBreakHandler ( ) is not None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( statement . getBlockContinueHandler ( ) is not None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( statement . getBlockReturnHandler ( ) is not None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# tried_statements = statement . getBlockTry ( ) . getStatements ( ) #NEWLINE# if ( len ( tried_statements ) != 1 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# handling_statements = except_handler . getStatements ( ) #NEWLINE# if ( len ( handling_statements ) != 1 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# tried_statement = tried_statements [ 0 ] #NEWLINE# if ( not tried_statement . isStatementAssignmentVariable ( ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# assign_source = tried_statement . getAssignSource ( ) #NEWLINE# if ( not assign_source . isExpressionBuiltinNext1 ( ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# handling_statement = handling_statements [ 0 ] #NEWLINE# if ( not handling_statement . isStatementConditional ( ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# yes_statements = handling_statement . getBranchYes ( ) . getStatements ( ) #NEWLINE# no_statements = handling_statement . getBranchNo ( ) . getStatements ( ) #NEWLINE# if ( len ( yes_statements ) != 1 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( not yes_statements [ 0 ] . isStatementLoopBreak ( ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( len ( no_statements ) != 1 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( ( not no_statements [ 0 ] . isStatementReraiseException ( ) ) or ( not no_statements [ 0 ] . isStatementReraiseException ( ) ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# tmp_name = context . allocateTempName ( 'next_source' ) #NEWLINE# generateExpressionCode ( expression = assign_source . getValue ( ) , to_name = tmp_name , emit = emit , context = context ) #NEWLINE# tmp_name2 = context . allocateTempName ( 'assign_source' ) #NEWLINE# old_source_ref = context . setCurrentSourceCodeReference ( ( assign_source . getSourceReference ( ) if Options . isFullCompat ( ) else statement . getSourceReference ( ) ) ) #NEWLINE# getBuiltinLoopBreakNextCode ( to_name = tmp_name2 , value = tmp_name , emit = emit , context = context ) #NEWLINE# getVariableAssignmentCode ( tmp_name = emit , variable = tried_statement . getTargetVariableRef ( ) . getVariable ( ) , needs_release = None , in_place = False , emit = emit , context = context ) #NEWLINE# context . setCurrentSourceCodeReference ( old_source_ref ) #NEWLINE# if context . needsCleanup ( tmp_name2 ) : #NEWLINE# #INDENT# context . removeCleanupTempName ( tmp_name2 ) #NEWLINE# #UNINDENT# return True