def iter_token_lines(tokenlist):
 line = []
 for (token, c) in explode_tokens(tokenlist):
  line.append((token, c))
  if (c == u'\n'):
   (yield line)
   line = []
 (yield line)

def iter_token_lines ( tokenlist ) : line = [ ] for ( token , c ) in explode_tokens ( tokenlist ) : line . append ( ( token , c ) ) if ( c == u'\n' ) : ( yield line ) line = [ ] ( yield line )
iterator that yields tokenlists for each line .