MCPcopy Create free account
hub / github.com/ipython/ipython / buffered_tokens

Method buffered_tokens

IPython/lib/lexers.py:338–358  ·  view source on GitHub ↗

Generator of unprocessed tokens after doing insertions and before changing to a new state.

(self)

Source from the content-addressed store, hash-verified

336 self.insertions = []
337
338 def buffered_tokens(self):
339 """
340 Generator of unprocessed tokens after doing insertions and before
341 changing to a new state.
342
343 """
344 if self.mode == 'output':
345 tokens = [(0, Generic.Output, self.buffer)]
346 elif self.mode == 'input':
347 tokens = self.pylexer.get_tokens_unprocessed(self.buffer)
348 else: # traceback
349 tokens = self.tblexer.get_tokens_unprocessed(self.buffer)
350
351 for i, t, v in do_insertions(self.insertions, tokens):
352 # All token indexes are relative to the buffer.
353 yield self.index + i, t, v
354
355 # Clear it all
356 self.index += len(self.buffer)
357 self.buffer = u''
358 self.insertions = []
359
360 def get_mci(self, line):
361 """

Callers 1

Calls 1

Tested by

no test coverage detected