Lines Matching refs:tokens

49     Iterates over tokens in given token stream, identifies goog.provide tokens,
54 token: A token in the token stream before any goog.provide tokens.
74 Iterates over tokens in given token stream, identifies goog.require tokens,
79 token: A token in the token stream before any goog.require tokens.
114 def _FixProvidesOrRequires(self, tokens):
118 tokens: A list of goog.provide or goog.require tokens in the order they
122 strings = self._GetRequireOrProvideTokenStrings(tokens)
126 # goog.provide tokens.
127 first_token = tokens[0]
128 last_token = tokens[-1]
135 # A map from required/provided object name to tokens that make up the line
138 tokens_map = self._GetTokensMap(tokens)
140 # Iterate over the map removing all tokens.
146 # Re-add all tokens in the map in alphabetical order.
147 insert_after = tokens[0].previous
154 """Gets all goog.provide or goog.require tokens in the given token stream.
159 tokens to find.
162 A list of goog.provide or goog.require tokens in the order they appear in
165 tokens = []
169 tokens.append(token)
176 return tokens
178 def _GetRequireOrProvideTokenStrings(self, tokens):
179 """Gets a list of strings corresponding to the given list of tokens.
182 tokens. This is used to find the object being provided/required by a given
186 tokens: A list of goog.provide or goog.require tokens.
190 list of tokens. For example:
195 for token in tokens:
200 def _GetTokensMap(self, tokens):
201 """Gets a map from object name to tokens associated with that object.
206 tokens on the same line as the goog.provide/goog.require token with that
210 tokens: A list of goog.provide or goog.require tokens.
213 A dictionary that maps object names to the tokens associated with the
221 The list of tokens includes any comment lines above the goog.provide or
230 for token in tokens:
250 """Gets a list of all tokens from first_token to last_token, inclusive.
257 A list of all tokens between first_token and last_token, including both
267 raise Exception('ran out of tokens')