#NEWLINE# def _GetTokensMap( self , tokens ) : #NEWLINE# #INDENT# "Gets a map from object name to tokens associated with that object.\n\n    Starting from the goog.provide/goog.require token, searches backwards in the\n    token stream for any lines that start with a comment. These lines are\n    associated with the goog.provide/goog.require token. Also associates any\n    tokens on the same line as the goog.provide/goog.require token with that\n    token.\n\n    Args:\n      tokens: A list of goog.provide or goog.require tokens.\n\n    Returns:\n      A dictionary that maps object names to the tokens associated with the\n      goog.provide or goog.require of that object name. For example:\n\n      {\n        'object.a': [JavaScriptToken, JavaScriptToken, ...],\n        'object.b': [...]\n      }\n\n      The list of tokens includes any comment lines above the goog.provide or\n      goog.require statement and everything after the statement on the same\n      line. For example, all of the following would be associated with\n      'object.a':\n\n      /** @suppress {extraRequire} */\n      goog.require('object.a'); // Some comment.\n    " #NEWLINE# tokens_map = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for token in tokens : #NEWLINE# #INDENT# object_name = tokenutil . GetStringAfterToken ( token ) #NEWLINE# first_token = token #NEWLINE# previous_first_token = tokenutil . GetFirstTokenInPreviousLine ( first_token ) #NEWLINE# while ( previous_first_token and previous_first_token . IsAnyType ( Type . COMMENT_TYPES ) ) : #NEWLINE# #INDENT# first_token = previous_first_token #NEWLINE# previous_first_token = tokenutil . GetFirstTokenInPreviousLine ( object_name ) #NEWLINE# #UNINDENT# last_token = tokenutil . GetLastTokenInSameLine ( token ) #NEWLINE# all_tokens = self . _GetTokenList ( first_token , last_token ) #NEWLINE# tokens_map [ object_name ] = all_tokens #NEWLINE# #UNINDENT# return tokens_map