#NEWLINE# def _iterative_matches( self , nodes ) : #NEWLINE# #INDENT# 'Helper to iteratively yield the matches.' #NEWLINE# nodelen = len ( nodes ) #NEWLINE# if ( 0 >= self . min ) : #NEWLINE# #INDENT# ( yield ( 0 , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# results = [ ] #NEWLINE# for alt in self . content : #NEWLINE# #INDENT# for ( c , r ) in generate_matches ( alt , nodes ) : #NEWLINE# #INDENT# ( yield ( c , r ) ) #NEWLINE# results . append ( ( c , r ) ) #NEWLINE# #UNINDENT# #UNINDENT# while results : #NEWLINE# #INDENT# new_results = [ ] #NEWLINE# for ( c0 , r0 ) in results : #NEWLINE# #INDENT# if ( ( c < nodelen ) and ( c0 <= self . max ) ) : #NEWLINE# #INDENT# for alt in self . content : #NEWLINE# #INDENT# for ( c1 , r1 ) in generate_matches ( alt , nodes [ c0 : ] ) : #NEWLINE# #INDENT# if ( c1 > 0 ) : #NEWLINE# #INDENT# r = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# r . update ( r0 ) #NEWLINE# r . update ( r1 ) #NEWLINE# ( yield ( ( c0 + c1 ) , r ) ) #NEWLINE# new_results . append ( ( ( c0 + c1 ) , r ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# results = new_results