MCPcopy Index your code
hub / github.com/RustPython/RustPython / TokenInfo

Class TokenInfo

Lib/tokenize.py:47–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

tokenizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected