#NEWLINE# def _GetRequireOrProvideTokens( self , token , token_string ) : #NEWLINE# #INDENT# "Gets all goog.provide or goog.require tokens in the given token stream.\n\n    Args:\n      token: The first token in the token stream.\n      token_string: One of 'goog.provide' or 'goog.require' to indicate which\n                    tokens to find.\n\n    Returns:\n      A list of goog.provide or goog.require tokens in the order they appear in\n      the token stream.\n    " #NEWLINE# tokens = [ ] #NEWLINE# while token : #NEWLINE# #INDENT# if ( token . type == Type . IDENTIFIER ) : #NEWLINE# #INDENT# if ( token . string == token_string ) : #NEWLINE# #INDENT# tokens . append ( token ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( token_string . string not in [ 'goog.provide' , 'goog.require' , 'goog.setTestOnly' ] ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# token = token . next #NEWLINE# #UNINDENT# return tokens