code: def next_token(text):
      r
      while text.hasNext():
          for name, f in tokenizers:
              current_token = f(text)
              if current_token is not None:
                  return current_token
docs: r"""Returns the next possible token, advancing the iterator to the next
      position to start processing from.
  
      :param Union[str,iterator,Buffer] text: LaTeX to process
      :return str: the token
  
      >>> b = Buffer(r'\textbf{Do play\textit{nice}.}   $$\min_w \|w\|_2^2$$')
      >>> print(next_token(b), next_token(b), next_token(b), next_token(b))
      \textbf { Do play \textit
      >>> print(next_token(b), next_token(b), next_token(b), next_token(b))
      { nice } .
      >>> print(next_token(b))
      }
      >>> print(next_token(Buffer('.}')))
      .
      >>> next_token(b)
      '   '
      >>> next_token(b)
      '$$'
      >>> b2 = Buffer(r'\gamma = \beta')
      >>> print(next_token(b2), next_token(b2), next_token(b2))
      \gamma  =  \beta