MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / TokenInfo

Class TokenInfo

tools/python-3.11.9-amd64/Lib/tokenize.py:46–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44del token
45
46class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):
47 def __repr__(self):
48 annotated_type = '%d (%s)' % (self.type, tok_name[self.type])
49 return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %
50 self._replace(type=annotated_type))
51
52 @property
53 def exact_type(self):
54 if self.type == OP and self.string in EXACT_TOKEN_TYPES:
55 return EXACT_TOKEN_TYPES[self.string]
56 else:
57 return self.type
58
59def group(*choices): return '(' + '|'.join(choices) + ')'
60def any(*choices): return group(*choices) + '*'

Callers 2

_tokenizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected