MCPcopy
hub / github.com/andialbrecht/sqlparse / token_prev

Method token_prev

sqlparse/sql.py:276–283  ·  view source on GitHub ↗

Returns the previous token relative to *idx*. If *skip_ws* is ``True`` (the default) whitespace tokens are ignored. If *skip_cm* is ``True`` comments are ignored. ``None`` is returned if there's no previous token.

(self, idx, skip_ws=True, skip_cm=False)

Source from the content-addressed store, hash-verified

274 return self._token_matching(funcs, idx)[1]
275
276 def token_prev(self, idx, skip_ws=True, skip_cm=False):
277 """Returns the previous token relative to *idx*.
278
279 If *skip_ws* is ``True`` (the default) whitespace tokens are ignored.
280 If *skip_cm* is ``True`` comments are ignored.
281 ``None`` is returned if there's no previous token.
282 """
283 return self.token_next(idx, skip_ws, skip_cm, _reverse=True)
284
285 # TODO: May need to re-add default value to idx
286 def token_next(self, idx, skip_ws=True, skip_cm=False, _reverse=False):

Callers 10

get_parent_nameMethod · 0.95
group_commentsFunction · 0.80
group_orderFunction · 0.80
align_commentsFunction · 0.80
_split_kwdsMethod · 0.80
_split_statementsMethod · 0.80
_process_defaultMethod · 0.80
_processMethod · 0.80
_processMethod · 0.80

Calls 1

token_nextMethod · 0.95

Tested by

no test coverage detected