docs: def get_tokens_unprocessed(self, text=None, context=None):
          """
          Split ``text`` into (tokentype, text) pairs.
          If ``context`` is given, use this lexer context instead.
          """
          tokendefs = self._tokens
          if not context:
              ctx = LexerContext(text, 0)
              statetokens = tokendefs['root']
          else:
              ctx = context
              statetokens = tokendefs[ctx.stack[-1]]
              text = ctx.text
          while 1:
              for rexmatch, action, new_state in statetokens:
                  m = rexmatch(text, ctx.pos, ctx.end)
                  if m:
                      if action is not None:
                          if type(action) is _TokenType:
                              yield ctx.pos, action, m.group()
                              ctx.pos = m.end()
                          else:
                              for item in action(self, m, ctx):
                                  yield item
                              if not new_state:
                                  # altered the state stack?
                                  statetokens = tokendefs[ctx.stack[-1]]
                      # CAUTION: callback must set ctx.pos!
                      if new_state is not None:
                          # state transition
                          if isinstance(new_state, tuple):
                              for state in new_state:
                                  if state == '#pop':
                                      ctx.stack.pop()
                                  elif state == '#push':
                                      ctx.stack.append(ctx.stack[-1])
                                  else:
                                      ctx.stack.append(state)
                          elif isinstance(new_state, int):
                              # pop
                              del ctx.stack[new_state:]
                          elif new_state == '#push':
                              ctx.stack.append(ctx.stack[-1])
                          else:
                              assert False, "wrong state def: %r" % new_state
                          statetokens = tokendefs[ctx.stack[-1]]
                      break
              else:
                  try:
                      if ctx.pos >= ctx.end:
                          break
                      if text[ctx.pos] == '\n':
                          # at EOL, reset state to "root"
                          ctx.stack = ['root']
                          statetokens = tokendefs['root']
                          yield ctx.pos, Text, u'\n'
                          ctx.pos += 1
                          continue
                      yield ctx.pos, Error, text[ctx.pos]
                      ctx.pos += 1
                  except IndexError:
                      break