<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def next_token(text):
 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 \textbf { Do play \textit { nice } . } . ' ' '$$' \gamma = \beta """

    while text.hasNext():
        for name, f in tokenizers:
            current_token = f(text)
            if current_token is not None:
                return current_token