def get_tokens_unprocessed(self, text):
    mlexer = MatlabLexer(**self.options)
    curcode = ''
    insertions = []
    for match in line_re.finditer(text):
        line = match.group()
        if line.startswith('>>'):
            insertions.append((len(curcode), [(0, Generic.Prompt, line[:3])]))
            curcode += line[3:]
        elif line.startswith('???'):
            idx = len(curcode)
            line = ('\n' + line)
            token = (0, Generic.Traceback, line)
            insertions.append((idx, [token]))
        else:
            if curcode:
                for item in do_insertions(insertions, mlexer.get_tokens_unprocessed(curcode)):
                    (yield item)
                curcode = ''
                insertions = []
            (yield (match.start(), Generic.Output, line))
    if curcode:
        for item in do_insertions(insertions, mlexer.get_tokens_unprocessed(curcode)):
            (yield item)
def get_tokens_unprocessed(self, text):
    mlexer = MatlabLexer(**self.options)
    curcode = 
    insertions = []
    for match in line_re.finditer(text):
        line = match.group()
        if line.startswith('>>'):
            insertions.append((len(curcode), [(0, Generic.Prompt, line[:3])]))
            curcode += line[3:]
        elif line.startswith('???'):
            idx = len(curcode)
            line = ('\n' + line)
            token = (0, Generic.Traceback, line)
            insertions.append((idx, [token]))
        else:
            if curcode:
                for item in do_insertions(insertions, mlexer.get_tokens_unprocessed(curcode)):
                    (yield item)
                curcode = 
                insertions = []
            (yield (match.start(), Generic.Output, line))
    if curcode:
        for item in do_insertions(insertions, mlexer.get_tokens_unprocessed(curcode)):
            (yield item)