#NEWLINE# def _lookahead_token( self , count = 1 ) : #NEWLINE# #INDENT# ' Peeks into the token stream up to the specified number of tokens\n            without consuming any tokens from the stream.\n\n            ``count``\n                Look ahead in stream up to a maximum number of tokens.\n\n            Returns string token or ``None``.\n            ' #NEWLINE# stack = [ ] #NEWLINE# next_token = None #NEWLINE# while ( count > 0 ) : #NEWLINE# #INDENT# item = self . _lexer . get_token ( ) #NEWLINE# if ( not item ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# stack . append ( item ) #NEWLINE# count -= 1 #NEWLINE# #UNINDENT# while stack : #NEWLINE# #INDENT# ( line_no , token ) = stack . pop ( ) #NEWLINE# if ( not next_token ) : #NEWLINE# #INDENT# next_token = token #NEWLINE# #UNINDENT# self . _lexer . push_token ( line_no , token ) #NEWLINE# #UNINDENT# return next_token