MCPcopy Index your code
hub / github.com/ipython/ipython / _parse_tokens

Function _parse_tokens

IPython/core/completer.py:1432–1442  ·  view source on GitHub ↗

Parse tokens even if there is an error.

(c)

Source from the content-addressed store, hash-verified

1430
1431
1432def _parse_tokens(c):
1433 """Parse tokens even if there is an error."""
1434 tokens = []
1435 token_generator = tokenize.generate_tokens(iter(c.splitlines()).__next__)
1436 while True:
1437 try:
1438 tokens.append(next(token_generator))
1439 except tokenize.TokenError:
1440 return tokens
1441 except StopIteration:
1442 return tokens
1443
1444
1445def _match_number_in_dict_key_prefix(prefix: str) -> Union[str, None]:

Callers 3

_attr_matchesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…