mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-20 14:35:44 +00:00
LaTeX reader: peek at next token directly in peekTok.
peekTok went through lookAhead (satisfyTok (const True)), paying for tokenPrim position bookkeeping, the raw-token state update, and lookAhead state save/restore on every call; peekTok is used by the main inline and block dispatchers for every element. Just examine the head of the input stream after expanding macros. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
0a46c96458
commit
4dcf5d5db3
@@ -579,7 +579,10 @@ satisfyTok f = do
|
||||
peekTok :: PandocMonad m => LP m Tok
|
||||
peekTok = do
|
||||
doMacros
|
||||
lookAhead (satisfyTok (const True))
|
||||
TokStream _ toks <- getInput
|
||||
case toks of
|
||||
t : _ -> return t
|
||||
[] -> mzero
|
||||
|
||||
doMacros :: PandocMonad m => LP m ()
|
||||
doMacros = do
|
||||
|
||||
Reference in New Issue
Block a user