-- Parse a /logical unit/ of tokens. This is either a single 'Token'
-- ('TeXChar', 'CtrlSeq', 'Param') or a group or a possibly empty list
-- of tokens resulting from macro expansion. We try to parse as little
-- structure as possible. Still we need to recognize groups because
-- many lexer-level commands have group scope (e.g. @\\catcode@).
token :: HandleTeXIO m => LexerT m [Token]
token = anyWhite <|> group <|> ctrlseq <|>
        count 1 (param <|> someChar)
token :: HandleTeXIO m => LexerT m [Token]
token = anyWhite <|> group <|> ctrlseq <|>
        count 1 (param <|> someChar)
token = anyWhite <|> group <|> ctrlseq <|>
        count 1 (param <|> someChar)