LaTeX reader: small efficiency improvement.

This commit is contained in:
John MacFarlane 2018-10-15 15:54:33 -07:00
parent 1db585689a
commit ae51de3b3d

View file

@ -375,8 +375,9 @@ toksToString = T.unpack . untokenize
satisfyTok :: PandocMonad m => (Tok -> Bool) -> LP m Tok
satisfyTok f = do
doMacros -- apply macros on remaining input stream
res <- tokenPrim (T.unpack . untoken) updatePos matcher
updateState $ \st -> st{ sExpanded = False }
tokenPrim (T.unpack . untoken) updatePos matcher
return res
where matcher t | f t = Just t
| otherwise = Nothing
updatePos :: SourcePos -> Tok -> [Tok] -> SourcePos