MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/252124_LaTeX_codec/recipe-252124.py:131–135  ·  view source on GitHub ↗

Create a new token converter from a string.

(self,tex)

Source from the content-addressed store, hash-verified

129 return self
130
131 def __init__(self,tex):
132 """Create a new token converter from a string."""
133 self.tex = tuple(_tokenize(tex)) # turn tokens into indexable list
134 self.pos = 0 # index of first unprocessed token
135 self.lastoutput = 'x' # lastoutput must always be nonempty string
136
137 def __getitem__(self,n):
138 """Return token at offset n from current pos."""

Callers

nothing calls this directly

Calls 1

_tokenizeFunction · 0.70

Tested by

no test coverage detected