parameters: (self, tokens)
return_statement: return tokens_map
docstring: Gets a map from object name to tokens associated with that object.
  
      Starting from the goog.provide/goog.require token, searches backwards in the
      token stream for any lines that start with a comment. These lines are
      associated with the goog.provide/goog.require token. Also associates any
      tokens on the same line as the goog.provide/goog.require token with that
      token.
  
      Args:
        tokens: A list of goog.provide or goog.require tokens.
  
      Returns:
        A dictionary that maps object names to the tokens associated with the
        goog.provide or goog.require of that object name. For example:
  
        {
          'object.a': [JavaScriptToken, JavaScriptToken, ...],
          'object.b': [...]
        }
  
        The list of tokens includes any comment lines above the goog.provide or
        goog.require statement and everything after the statement on the same
        line. For example, all of the following would be associated with
        'object.a':
  
        /** @suppress {extraRequire} */
        goog.require('object.a'); // Some comment.
docstring_summary: Gets a map from object name to tokens associated with that object.
docstring_tokens: Gets a map from object name to tokens associated with that object .
function: def _GetTokensMap(self, tokens):
      """Gets a map from object name to tokens associated with that object.
  
      Starting from the goog.provide/goog.require token, searches backwards in the
      token stream for any lines that start with a comment. These lines are
      associated with the goog.provide/goog.require token. Also associates any
      tokens on the same line as the goog.provide/goog.require token with that
      token.
  
      Args:
        tokens: A list of goog.provide or goog.require tokens.
  
      Returns:
        A dictionary that maps object names to the tokens associated with the
        goog.provide or goog.require of that object name. For example:
  
        {
          'object.a': [JavaScriptToken, JavaScriptToken, ...],
          'object.b': [...]
        }
  
        The list of tokens includes any comment lines above the goog.provide or
        goog.require statement and everything after the statement on the same
        line. For example, all of the following would be associated with
        'object.a':
  
        /** @suppress {extraRequire} */
        goog.require('object.a'); // Some comment.
      """
      tokens_map = {}
      for token in tokens:
        object_name = tokenutil.Search(token, Type.STRING_TEXT).string
        # If the previous line starts with a comment, presume that the comment
        # relates to the goog.require or goog.provide and keep them together when
        # sorting.
        first_token = token
        previous_first_token = tokenutil.GetFirstTokenInPreviousLine(first_token)
        while previous_first_token.IsAnyType(Type.COMMENT_TYPES):
          first_token = previous_first_token
          previous_first_token = tokenutil.GetFirstTokenInPreviousLine(
              first_token)
  
        # Find the last token on the line.
        last_token = tokenutil.GetLastTokenInSameLine(token)
  
        all_tokens = self._GetTokenList(first_token, last_token)
        tokens_map[object_name] = all_tokens
      return tokens_map
function_tokens: def _GetTokensMap ( self , tokens ) : tokens_map = { } for token in tokens : object_name = tokenutil . Search ( token , Type . STRING_TEXT ) . string # If the previous line starts with a comment, presume that the comment # relates to the goog.require or goog.provide and keep them together when # sorting. first_token = token previous_first_token = tokenutil . GetFirstTokenInPreviousLine ( first_token ) while previous_first_token . IsAnyType ( Type . COMMENT_TYPES ) : first_token = previous_first_token previous_first_token = tokenutil . GetFirstTokenInPreviousLine ( first_token ) # Find the last token on the line. last_token = tokenutil . GetLastTokenInSameLine ( token ) all_tokens = self . _GetTokenList ( first_token , last_token ) tokens_map [ object_name ] = all_tokens return tokens_map